PHP Classes

Print Anything: Make a browser print a given HTML document

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (4)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 65%Total: 4,596 This week: 1All time: 611 This week: 560Up
Version License PHP version Categories
print_anything 0.1.1MIT/X Consortium ...4HTML, Printing
Description 

Author

This class can be used to make a browser print a given HTML document.

It generates HTML with special Javascript code and CSS style sheet that includes the whole page in a non-printable section and adds a new page section with given HTML that you want to print, but it is not displayed in the browser.

The class can also generate links of form buttons that when clicked trigger the execution of the generated Javascript code making the browser printing dialog open to print the HTML document section that it is intended to be printed.

Each page may have multiple print links or form buttons to print distinct HTML documents.

Innovation Award
PHP Programming Innovation award nominee
March 2008
Number 8


Prize: http://www.apress.com/
Often users want to print contents of Web pages. A page can easily be printed using a button attached with some Javascript code. However, usually not everything displayed on a Web page is intended to be sent to the printer.

This class implements a clever solution that makes use of Javascript and CSS to send to the printer only the relevant parts of the page content.

Manuel Lemos
Picture of Vagharshak Tozalakyan
Name: Vagharshak Tozalakyan <contact>
Classes: 22 packages by
Country: United States United States
Age: 44
All time rank: 61 in United States United States
Week rank: 411 Down48 in United States United States Down
Innovation award
Innovation award
Nominee: 7x

  Files folder image Files  
File Role Description
Plain text file class.PrintAnything.php Class Class Source
Accessible without login Plain text file example.php Example Sample
Accessible without login Plain text file howto.txt Doc. Help
Accessible without login Plain text file test.php Aux. Example of external output (used by example.php)

 Version Control Unique User Downloads Download Rankings  
 0%
Total:4,596
This week:1
All time:611
This week:560Up
User Ratings User Comments (3)
 All time
Utility:85%StarStarStarStarStar
Consistency:85%StarStarStarStarStar
Documentation:65%StarStarStarStar
Examples:80%StarStarStarStarStar
Tests:-
Videos:-
Overall:65%StarStarStarStar
Rank:622
 
thanks .
9 years ago (Mehrdad Dadkhah)
75%StarStarStarStar
good one
10 years ago (akhilvl)
70%StarStarStarStar
from me A++ excelent work
15 years ago (ursan paul)
75%StarStarStarStar