You are here: Re: Printer Friendly page « PHP Programming Language « IT news, forums, messages
Re: Printer Friendly page

Posted by R. Rajesh Jeba Anbiah on 12/11/85 11:55

Erwin Moller wrote:
<snip>
> I always solve this the simple way:
> 1) Make a button: "Printer friendly page"
> 2) If somebody hits that button, simply create a popupwindow in which you
> retrieve the data again, and display it with little/no colors, just black
> and white.
> From there you can call window.print() safely.
>
> Alternatively, you can make a stylesheet for the printer, and tell the
> browser to use that (without the popupwindow). That should work too, but I
> prefer the first option because the user can see what will be printed
> beforehand excactly.
<snip>

FWIW, my way:
1. print.css set to print media and other style and alternate styles
for screen
2. <a href="currentlink+?print=1" rel="nofollow"
class="print-link">Printer friendly page"</a>
* rel="nofollow" so that the crawlers won't crawl it (avoid multiple
crawl of same page)
3. Add popup window for the link by hooking "print-link" class using
Behaviour.js (now using modified better version of it and need to
document it)
4. The top global file sees if $_GET['print'] is set, if so, when it
renders styleseet related links, it sets print.css to screen and trims
other styles.

Advantages: Not much coding; easy to plug it to existing pages.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация