Print Scripts

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stebut05
Forum Commoner
Posts: 35
Joined: Wed Sep 21, 2005 9:29 am
Location: Liverpool, UK

Print Scripts

Post by stebut05 »

Hi all,

Hope someone can help pretty plz. I need to run a print script to print multiple records, but on seperate pages, is this possible??? if so, any ideas how to do it?? thanks for any help and advice given

Regards,

Steven
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

most reliable way: generate a PDF.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I have done this using CSS. Wrap each record you want on a new page inside a <p class="new_page"></p> tag set. Then add this to your CSS...

Code: Select all

p.new_page {
	page-break-before: always;
	text-align: center;
}
Everything wrapped in that styled <p> tag will appear on a new page (and centered, so modify that attribute and value if you don't want it that way).
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

hopefully the browser supports that setting ;)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Yeah, I know it's wishful thinking. Of course, FireFox supports it so almost everypage that I use that CSS on is referred by a page that I put a "Get FireFox" plug of some sort on.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

plugs are often ignored, along with banners :P

Users are more likely to just click back when the site doesn't "work" because they are not using the same browser as the developer :P
Post Reply