.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Net::CUPS 3pm" .TH Net::CUPS 3pm "2016-10-31" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::CUPS \- Common Unix Printing System Interface .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Net::CUPS; \& \& my $cups = Net::CUPS\->new(); \& \& my $printer = $cups\->getDestination( "lj4200dn" ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Net::CUPS is an object oriented interface to the Common Unix Printing System. .SH "METHODS" .IX Header "METHODS" .IP "\fBgetDestination\fR" 4 .IX Item "getDestination" my \f(CW$printer\fR = \f(CW$cups\fR\->getDestination( \f(CW$printer_name\fR ); .Sp This method takes the name of the printer to acquire. If the printer does not exist it will return nothing. .IP "\fBgetDestinations\fR" 4 .IX Item "getDestinations" my \f(CW@printers\fR = \f(CW$cups\fR\->\fIgetDestinations()\fR; .Sp This method will return an array of destinations currently configured on the cups server. .IP "\fBgetPassword\fR" 4 .IX Item "getPassword" my \f(CW$password\fR = \f(CW$cups\fR\->getPassword( \f(CW$prompt\fR ); .Sp Method to retrieve the password from the user via the password callback. .IP "\fBgetPPD\fR" 4 .IX Item "getPPD" my \f(CW$ppd\fR = \f(CW$cups\fR\->getPPD( \f(CW$name\fR ); .Sp Returns a Net::CUPS::PPD object for the default printer or for the specified printer or class. .IP "\fBgetPPDMakes\fR" 4 .IX Item "getPPDMakes" my \f(CW$makes\fR = \f(CW$cups\fR\->\fIgetPPDMakes()\fR; .Sp Returns an arrary of scalers holding the names of all the makers (e.g. \s-1HP\s0 or Lexmark) of \s-1PPD\s0 files installed on the \s-1CUPS\s0 server .IP "\fBgetAllPPDs\fR" 4 .IX Item "getAllPPDs" my \f(CW$ppds\fR = \f(CW$cups\fR\->\fIgetAllPPDs()\fR; .Sp Returns an array of scalers with the maker and model of all the PPDs installed on the \s-1CUPS\s0 server .IP "\fBgetPPDFileName\fR" 4 .IX Item "getPPDFileName" \&\f(CW$cups\fR\->getPPDFileName($ppd_name_and_make); .Sp Returns the file name of the \s-1PPD\s0 specified by the name and make as found in the array returned by getAllPPDs. The file name is used by addDestination and is relative to where the \s-1CUPS\s0 server is instructed to look (e.g /usr/share/ppd). .IP "\fBgetServer\fR" 4 .IX Item "getServer" my \f(CW$server_name\fR = \f(CW$cups\fR\->\fIgetServer()\fR; .Sp A method to return either the hostname or the \s-1IP\s0 address of the active print server. .IP "\fBgetUsername\fR" 4 .IX Item "getUsername" my \f(CW$username\fR = \f(CW$cups\fR\->\fIgetUsername()\fR; .Sp This method will return the current username associated with the \&\s-1CUPS\s0 transaction. .IP "\fBrequestData\fR" 4 .IX Item "requestData" my \f(CW$result\fR = \f(CW$cups\fR\->requestData( \f(CW$request\fR, \f(CW$resource\fR, \f(CW$filename\fR ); .Sp Send an \s-1IPP\s0 request to the server. This function is based off the C \s-1CUPS\s0 function cupsDoRequest and cupsDoRequestFile. The \f(CW$filename\fR is optional. .IP "\fBsetPasswordCB\fR" 4 .IX Item "setPasswordCB" \&\f(CW$cups\fR\->setPasswordCB( \f(CW$function\fR ) .Sp Method to set the callback function to be used by getPassword. .IP "\fBsetServer\fR" 4 .IX Item "setServer" \&\f(CW$cups\fR\->setServer( \f(CW$server_ip\fR ); .Sp This method will change the current cups server to another hosts. .IP "\fBsetUsername\fR" 4 .IX Item "setUsername" \&\f(CW$cups\fR\->setUsername( \f(CW$username\fR ); .Sp A method to change the username associated with \s-1CUPS\s0 interaction. .IP "\fBdeleteDestination\fR" 4 .IX Item "deleteDestination" \&\f(CW$cups\fR\->deleteDestination( \f(CW$destination_name\fR ); .Sp A method to delete an existing destination .IP "\fBaddDestination\fR" 4 .IX Item "addDestination" \&\f(CW$cups\fR\->addDestination( \f(CW$name\fR, \f(CW$location\fR, \f(CW$printer_info\fR, \f(CW$ppd_name\fR, \f(CW$device_uri\fR) A method to create a new destination. The \f(CW$ppd_name\fR variable should be the one returned for that printer by the getPPDFileName method. It will be relative to where the \s-1CUPS\s0 server is configured to look for \s-1PPD \s0 files (e.g. /usr/share/ppd). .SH "SEE ALSO" .IX Header "SEE ALSO" Net::CUPS::Destination, Net::CUPS::PPD, Net::CUPS::IPP .SH "SUPPORT" .IX Header "SUPPORT" Net::CUPS is currently maintained by Stefan Seifert . The Github repository for this project is at . Pull requests are welcome. .SH "AUTHOR" .IX Header "AUTHOR" Dracken Technology, Inc. (http://www.dracken.com/) .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Aike Reyer supplied the password handling code. .PP Mark Gannon supplied the code for \s-1PPD\s0 acquisition, destination creation and destination deletion. .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (c) 2003\-2005 David Hageman .PP Copyright (c) 2006\-2009 Dracken Technology, Inc. .PP All rights reserved. .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available. .PP \&\s-1CUPS,\s0 the Common \s-1UNIX\s0 Printing System, the \s-1CUPS\s0 logo, and \s-1ESP\s0 Print Pro are the trademark property of Easy Software Products.