It isn't uncommon to see a printer icon with some title text along the lines of, "Click here to see a printable version."
What is the most common way of doing this? Would one normally use JQuery or equiv to change the stylesheet for example?
Creating a printable version of a page
Moderator: General Moderators
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: Creating a printable version of a page
Personal preference really. What would you as a user prefer? Not discussing the non-js enabled users here guess you got it thought of.
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: Creating a printable version of a page
Can't say I'm particularly worried about non-JS users, my concern is to make this adaptation is quickly and painlessly as possible. What other methods might you suggest, if I wasn't to use JS for instance?
Re: Creating a printable version of a page
Well simple link to another page that has additinal ?print or /print to distinguish. User wouldn't really care as long as it is printable.
I wouldn't recommend any popups etc etc. Clean page with the appropriate styling of course. People can easily say file -> print or file -> save as
I wouldn't recommend any popups etc etc. Clean page with the appropriate styling of course. People can easily say file -> print or file -> save as
Re: Creating a printable version of a page
I prefer using CSS with media print, that eliminates need for javascript 
Re: Creating a printable version of a page
Thanks for taking the time to help, I really apprciate it.
-
infiniteacuity
- Forum Newbie
- Posts: 12
- Joined: Tue Jun 16, 2009 2:48 pm
- Location: Ft. Lauderdale
Re: Creating a printable version of a page
I agree with this as it also contains it to 1 area for easy editing.kaszu wrote:I prefer using CSS with media print, that eliminates need for javascript
Re: Creating a printable version of a page
Not necessarily. He wants to have a webpage show the printable version, not just separate styling for printout.kaszu wrote:I prefer using CSS with media print, that eliminates need for javascript
While I would include the <link rel = "stylesheet" type = "text/css" href = "print.css" media="print" /> on every page, I think the best approach for making a "See what this page will look like in a printout" page would be to have the print icon point to a ?print page, like ~jmut suggested. On that page, do some PHP figuring to only include the print stylesheet if $_GET['print'] is present.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.