Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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.


In reply to Re: Printer Friendly Pages by Maclir
in thread Printer Friendly Pages by arashi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2023-05-28 20:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?