As a user, issue the lpstat command with proper options:
# lpstat <options>
Options can be:
Each printer has a set of options derived from the PPD (driver) file. The
command allows you to see a list of the available options:
lpoptions -p <printer name> -l
HPOption_500_Sheet_Tray/500 Sheet Tray: True *False HPOption_Envelope_Feeder/Envelope Feeder: True *False HPOption_Duplexer/Duplex Unit: *True False HPOption_Memory/Total Memory: *4Meg 12Meg PageSize/Media Size: Letter LetterSmall Legal LegalSmall *A4 A4Small Executive Comm10 Monarch DL C5 B5 A5 PageRegion/PageRegion: Letter LetterSmall Legal LegalSmall A4 A4Small Executive Comm10 Monarch DL C5 B5 A5 InputSlot/Media Source: Upper *Lower LargeCapacity Envelope ManualFeed/Manual Feed: True *False HPHalftone/Levels of Gray: *Enhanced Standard Resolution/Printer Resolution: *600dpi 300dpi Duplex/Duplex: None *DuplexNoTumble DuplexTumble Smoothing/Resolution Enhancement: *None Light Medium Dark
The asterisk beside a value indicates the default value.
Some common print options are listed below. If an option accepts a value, then it is listed in the form option=value:
A user can set his own default options for a specific CUPS printer by issuing the command:
# lpoptions -p printer -o option1=value -o option2=value
Previously defined print options can be removed from ~/.lpoptions by:
# lpoptions -p printer -r option1 -r option2
A very useful CUPS feature is that sets of options can be defined. These can be system-wide if they are set by root, or user specific if they are set by a user. Printer instances are extra options for a specific printer that are saved as an extra printer in the form printer/set. This virtual printer’s settings override the default options.
To create a printer instance, as a user issue the command:
# lpoptions -p printer/set1 -o option1=value -o option2=value
To delete a printer instance issue the command:
# lpoptions -x printer/set1
The printer instance is listed as a printer in lpstat.
The user can send a document to the printer instance:
# lpr -P printer/set1 filename
One of the missing, but probably useful -Z options is -Z book. This rearranged pages in a document suitable for printing 2up,duplex and turning into a book. You can achieve the same result by using the psbook command to generate the required reordered pages of the PostScript file, and then printing 2up,tumble. eg
# psbook < myfile.ps | lpr -Z2up,tumbleor using CUPS's native options:
# psbook < myfile.ps | lpr -o number-up=2 -o sides=two-sided-short-edgeIf you want to print a PDF file in book format you can do it directly from acroread:
Alternatively you can convert the PDF to PostScript and use the above psbook command. eg:
# pdftops myfile.pdf - | psbook | lpr -o number-up=2 -o sides=two-sided-short-edgeIf you wish to select a subset of pages, insert "psselect -p<BeginPage>-<EndPage>" in the pipeline before "psbook". For example, to print the first four pages of a document, use:
# pdftops myfile.pdf - | psselect -p1-4 | psbook | lpr -o number-up=2 -o sides=two-sided-short-edge(which will print four pages - two pages per side, on one sheet).
If you wish to use Simplex (One-Sided printing):
# lpr -o sides=one-sided -P myprinter myfile.pdf
Please contact us with any comments or corrections.
Unless explicitly stated otherwise, all material is copyright The University of Edinburgh