Printer Friendly Page PHP
Free Javascript
Printer Friendly Page PHP
Free Javascript
courtesy of http://www.mikenew.net/
Note: Printer Friendly Page PHP
Free Javascript
more at http://www.mikenew.net/
PHPrint (2.1)
Credits:
www.mikenew.net
PHPrint will make printer friendly pages with or without images, at your discretion.
Requirements:
- PHP 4.0 or higher
- Platform: NT/IIS or Unix Combos
Briefly, here's how this "printer-friendly pages" script works:
You bury a tag high in your page, and low in your page. Then you place a link to this script anywhere in the page containing those
two tags. When clicked, it takes your surfer to a printer friendly version of the page they just left.
And now, to make a short story long:
1. Place 2 tags in your HTML page. Your pages can be almost anything, like ASP,
PHP, HTML, etc. It doesn't matter,
because you link out to the script. Put
<!-- startprint --> somewhere in your HTML page where you consider it to be the start of printer friendly content, and <!-- stopprint -->
goes at the end of that same content.
(FYI: This is the end of the printable part of the THIS page if you
demo it, because the end of this
sentence is where I buried the stopprint tag.)
2. Click here for the latest phprint.php code to download. , just upload to your site's root directory.
If you want to keep images on the printer friendly version of your pages, change the line near the top that says:
$stripImages = "no";
to
$stripImages = "yes";
It's set to automatically strip images if you don't change it.
3. Place a link to phprint.php anywhere on your HTML page that you want to be print-friendly, (preferably outside
the content with the startprint/stopprint tags).
Here's some HTML to cut and paste:
<a href="phprint.php" title="Printer friendly page">Print page</a>
4. Optional further customization: Want to attach a style sheet for further control of the displayed printer-friendly
page? Paste this before "<?php" in the script:
<link href="/main.css" rel="stylesheet" type="text/css">
(where main.css is the name of your cascading style sheet. Right-click mine and save it if you like..)