prepare a web page so that the client can send to printer

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
jsmeby
Forum Newbie
Posts: 1
Joined: Sat Jan 10, 2009 11:55 am

prepare a web page so that the client can send to printer

Post by jsmeby »

how to prepare a page containing a news article in simple html-tagged format to print to a print device?
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: prepare a web page so that the client can send to printer

Post by jaoudestudios »

Use the CSS media print option - if you have multiple page it might be tricky. For multiple pages I would suggest creating a pdf.
User avatar
volomike
Forum Regular
Posts: 633
Joined: Wed Jan 16, 2008 9:04 am
Location: Myrtle Beach, South Carolina, USA

Re: prepare a web page so that the client can send to printer

Post by volomike »

This should be useful to you:

http://www.javascriptkit.com/dhtmltutor ... reak.shtml

However, by default that's not elegant. So, what you do is specify a screen media CSS load rel -- you familiar with that? The load rel will specify one CSS to use for the screen, and then another load rel will specify for the printer. For the screen, take all the page breaks (see link above) and hide each section, letting someone use a click and some jQuery to flip between pages. For the printer, show everything as is. What happens is that when they go to view the page on the screen, they see it like a slideshow of pages. But when they go to print, it prints with proper page breaks.
Post Reply