|
NAMENet::Printer - Perl extension for direct-to-lpd printing.SYNOPSISuse Net::Printer; # Create new Printer Object $lineprinter = new Net::Printer( filename => "/home/jdoe/myfile.txt", printer => "lp", server => "printserver", port => 515, lineconvert => "YES" ); # Print the file $result = $lineprinter->printfile(); # Optionally print a file $result = $lineprinter->printfile("/home/jdoe/myfile.txt"); # Print a string $result = $lineprinter->printstring("Smoke me a kipper, I'll be back for breakfast."); # Did I get an error? $errstr = $lineprinter->printerror(); # Get Queue Status @result = $lineprinter->queuestatus(); DESCRIPTIONPerl module for directly printing to a print server/printer without having to create a pipe to either lpr or lp. This essentially mimics what the BSD LPR program does by connecting directly to the line printer printer port (almost always 515), and transmitting the data and control information to the print server.Please note that this module only talks to print servers that speak BSD. It will not talk to printers using SMB, SysV, or IPP unless they are set up as BSD printers. CUPS users will need to set up cups-lpd to provide legacy access. ( See "Using Net::Printer with CUPS" ) METHODSnewConstructor returning Net::Printer objectParameters A hash with the following keys:
Returns The blessed object printerrorGetter for error string, if any.Returns String containing error text, if any. Undef otherwise. printfileTransmits the contents of the specified file to the print serverParameters
Returns 1 on success, undef on fail printstringPrints the given string to the printer. Note that each string given to this method will be treated as a separate print job.Parameters
Returns 1 on succes, undef on fail queuestatusRetrives status information from print serverReturns Array containing queue status TROUBLESHOOTINGStair Stepping ProblemWhen printing text, if you have the infamous "stair-stepping" problem, try setting lineconvert to "YES". This should, in most cases, rectify the problem.RFC-1179 Compliance Mode and Security ImplicationsRFC 1179 specifies that any program connecting to a print service must use a source port between 721 and 731, which are reserved ports, meaning you must have root (administrative) privileges to use them. This is a security risk which should be avoided if at all possible!Using Net::Printer with CUPSNet::Printer does not natively speak to printers running CUPS (which uses the IPP protocol). In order to provide support for legacy clients, CUPS provides the cups-lpd mini-server which can be set up to run out of either inetd or xinetd depending on preference. You will need to set up this functionality in order to use Net::Printer with CUPS server. Consult your system documentation as to how to do this.SEE ALSOcups-lpd, lp, lpr, perlRFC 1179 <http://www.ietf.org/rfc/rfc1179.txt?number=1179> AUTHORChristopher M. Fuhrman "<cfuhrman at panix.com>"REVISION INFORMATION$Id: 9044ee617cffd95213cff21af410d8ea1dc3f1fd $ COPYRIGHT & LICENSECopyright (c) 2000-2005,2008,2011,2013 Christopher M. Fuhrman, All rights reserved.This program is free software licensed under the... The BSD License The full text of the license can be found in the LICENSE file included with this module.
Visit the GSP FreeBSD Man Page Interface. |