Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Printer Friendly Pages

by Maclir (Curate)
on Oct 09, 2001 at 02:12 UTC ( #117572=note: print w/replies, xml ) Need Help??


in reply to Printer Friendly Pages

I have developed a "printer friendly" option on pages generated by scripts. In my case, I used EmbPerl on the server, but I guess the principle is the same.

Place somewhere on the page a "printer friendly" link - and even put a printer icon next to it if you are super keen. The URL (or value in the "HREF" field) is the current URL, with a parm of "print=yes" appended to it. Now if you are already passing arguments, then you separate this with an ampersand, elsewise a ?.

Then, the server side script that generates the page looks for the presence of the "print=yes" parm. Then, when the html is being generated, select a CSS style sheet that is a "bare bones" format - no background image, no fancy colors, all that stuff. You can also have sone logic within the page generation script, such that if print is on, don't include other widgets, (including the "printer friendly" link), all that stuff.

What's that you say? Your aren't using style sheets at all? (deep sigh). Go to the back of the class. Now read all the material on the W3C page to understand why you should be.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://117572]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (1)
As of 2023-06-03 04:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (7 votes). Check out past polls.

    Notices?