Page 1 of 1

Show printer friendly version of this page

Posted: Fri Oct 25, 2002 4:25 am
by noguru
Hi

Can anyone please tell me how to use CGI or anything else to view a printer-friendly version of your web page? I've seen this on some discussion forums (especially on ww.vbworld.com), where a parameter is sent to a cgi script on the load of a page and another parameter is sent to the same cgi script on the click of a <a>Printer friendly</a> link. I've got hundreds of pages which the user might want to print, but I don't want to have a copy of everyone just formatted for printing.

Any help will be appreciated.

Thanks

Posted: Fri Oct 25, 2002 4:46 am
by twigletmac
Printer friendly generally means the removal of navigation and changes to the header and footer, it also commonly means that where an article spans several pages that they are all included onto one.

To create printer friendly pages easily there are a few approaches that you can take. You could use CSS and have two stylesheets one for display and another for printing (evolt.org article: Kissing Print Versions of Pages Goodbye). This is a great method for printing because there is no need to have a 'printer-friendly version' link, however, it won't work for older browsers.

Another method that works well when you are using PHP to include() your content into a page layout, is to have a separate page layout specifically for printing where you include() the content into a page which is more printer-friendly than your original setup.

Basically, how you do it depends on how your page is setup, what browsers you are targetting and what exactly you need from a printer-friendly page. Oh and it doesn't have to be a CGI solution...

Mac