PHP Classes

PHP Print: Abstraction for printing documents

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (8)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 59%Total: 15,633 This week: 2All time: 54 This week: 96Down
Version License PHP version Categories
php_print_lpr 1.0.0GNU Lesser Genera...5PHP 5, Printing
Description 

Author

This package provides an abstract interface for printing documents.

Currently the package includes one implemented class that allows printing of basic text or preformatted (.prn) document files using the LPR protocol

The data to be sent to the printer can be either a filename or a string.

The driver interface provides hooks in the code to allow development of printer filters (drivers). Other driver classes can be developed to implement custom printer filtering like for instance to send documents to Postscript printers.

Innovation Award
PHP Programming Innovation award nominee
September 2005
Number 5


Prize: One copy of DWeb Pro Lifetime License
Many Web applications need to provide means to print documents that they generate.

Printing documents is a task that can be implemented in ways that depend on the device into which the documents are printed, and also on the operating system in use.

This class provides an abstract interface that separates the generation of document printing data from the actual printing process. Many drivers can be developed to support different types of printing processes.

Manuel Lemos
Picture of Mick Sear
Name: Mick Sear is available for providing paid consulting. Contact Mick Sear .
Classes: 8 packages by
Country: United Kingdom
Age: 50
All time rank: 372 in United Kingdom
Week rank: 34 Up3 in United Kingdom Down
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

Recommendations

Printing page setting dynamically
Need to print page setting options dynamically

Example

<?php
/*
Example of use of PrintSendLPR
@author Mick Sear
eCreate 2005
LGPL
*/

error_reporting(E_ALL);

include(
"PrintSend.php");
include(
"PrintSendLPR.php");

echo
"<h1>PrintSendLPR example</h1>";
$lpr = new PrintSendLPR();
$lpr->setHost("10.0.0.17");//Put your printer IP here
$lpr->setData("C:\\wampp2\\htdocs\\print\\test.txt");//Path to file, OR string to print.

echo $lpr->printJob("someQueue");//If your printer has a built-in printserver, it might just accept anything as a queue name.
echo "<h3>Debug</h3><pre>".$lpr->getDebug()."</pre>";

?>


Screenshots  
  • example.gif
  Files folder image Files  
File Role Description
Plain text file lpr_example.php Example Example of use
Plain text file PrintSend.php Class Abstract Class
Plain text file PrintSendLPR.php Class LPR class
Plain text file test.txt Data Test data file

 Version Control Unique User Downloads Download Rankings  
 0%
Total:15,633
This week:2
All time:54
This week:96Down
User Ratings User Comments (4)
 All time
Utility:85%StarStarStarStarStar
Consistency:82%StarStarStarStarStar
Documentation:-
Examples:88%StarStarStarStarStar
Tests:-
Videos:-
Overall:59%StarStarStar
Rank:1250
 
nice
7 years ago (Infonet)
70%StarStarStarStar
good game
7 years ago (muabshir)
70%StarStarStarStar
This works very well and was very easy to implement
10 years ago (Billy Hallman)
70%StarStarStarStar
Lite code for good function
15 years ago (Serge IZOARD)
67%StarStarStarStar