WEB2PRINTER PHP

Posted by on in PROJECTS
  • Font size: Larger Smaller
  • Hits: 14149
  • Print

web2printer php

Printer friendly webpages on the fly. Virtually every web page contain information's that is only usable while browsing the website. In contrast importation informations are lost while printing, Hyperlinks for example. Web2printer closes this gap since 2001 and transforms every web page in a printer-friendly manner.

Web2Printer is the first and most powerful printer-friendly OSS today.

Prerequisites

PHP 5.3

Functions

Web2Printer works online, real-time. There is no need to define a second, "hidden" page. Just put a hyperlink in your document. Web2Printer generates a meaningful page footer, to preserves the origin and navigation information.
The footer contains:

  • The page url
  • content of the author and copyright meta tags
  • a hyperlink cross reference
  • a image cross reference
  • images replaced with the alt="" tag content

Put the relevant page content with in to two html comments:
<!-- web2printer:start -->
every thing between this comments is transformed in a printable manner
<!-- web2printer:end -->

Examples

Picture, ALT-Tag is "Apache Software Foundation"

Apache Software Foundation

Links:
http://www.rka2.de
http://phpshaper.com/
http://phpshaper.com/

Links:

http://www.rka2.dehttp://www.rka2.de
http://phpshaper.com
http://phpshaper.com/easyblog/2014/01/29/51-print-friendly-webpages-php.html

Usage example:
http://phpshaper.com/w2p/web2printer-de.php?page=/easyblog/2014/01/29/56-print-friendly-webpages-php-de.htmll&lnk=1&img=3

Parameters

Web2printer accepts get and post parameters. All parameters are optional and validated before they are processed.

 
 parameter value  meaning   constraint
 lnk      length == 1, numeric, between  1 and 2
   1  create hyperlink xref  
   2  create hyperlink xref and remove get parameters  
 img      length ==1, numeric, between 1 and 4
   1  supress images  
   2  replace images with IMAGE  
   3  replace images with alt="" tag  
   4  replace images with alt="" tag and create a image xref  
tgs     length == 1, numeric
  1 preserve metatags  
page      valid path, max 255 chars
    page to print (relative or absolute path, _without_ hostname and port)  
style     length =< 255, string
    stylsheet used for printing  

Configuration

The web2printer configuration and localization is done within a ini file. The name is config-LANGUAGE.ini.
The Language parameter is substituted with the constructor parameter language.

For $web2printer = new Web2Printer("de"); the ini filename becomes config-de.ini
For $web2printer = new Web2Printer("en"); the ini filename becomes config-en.ini

Configuration parameters

; active link
; 0 - hyperlinks not active (clickable) in the resulting html file
; 1 - hyperlinks active (clickable) in the resulting html file
activeLinks = 0
; 0 disable footer
; 1 enable footer
; 2 use custom footer
footer = 1
; page url header:
pageUrlHeader = "<b>This page URLs</b>:<br>"
; page url crossreference header:
pageXRefURLHeader = "<b>Links:</b>"
; page images crossreference header:
pageXRefImages = "<b>Images:</b>"
; custom footer text - if you not enjoy the standard footer
; this page was generated with ....
customFooter = "";

Reference

Homepage: http://phpshaper.com
E-Mail: info (at) phpshaper.com
GITHUB: https://github.com/phpshaper/web2printer-php
Example: http://phpshaper.com/printer-friendly/examples.html

Rate this blog entry:
0
Trackback URL for this blog entry.

QUICK LINKS

LEGAL