Printing with Command Line

Description

Syntax

Example

List all printers

lpstat -a

lstat -a

Show default printer

lpstat -d

lstat -d

Set default printer

lpoptions -d <printer>

lpoptions -d k

Print

lp [-d <printer>] <file>

lp -d h52 paper.pdf

Printing n copies (see note 1)

lp -n <number> [-d <printer>] <file>

lp -n 5 paper.pdf

Printing n copies (see note 1) in the order 1,2,3...

lp -o Collate=True -n <number> <file>

lp -o Collate=true -n 5 paper.pdf

Print 2 pages on one site

lp -o number-up=2 <file>

lp -p number-up=2 paper.pdf

Printing one sided on a duplex printer

lp -o duplex=None <file>

lp -o duplex=None paper.pdf

Printing duplex with turning on short edge

lp -o duplex=DuplexTumble <file>

lp -o duplex=DuplexTumble paper.pdf

Printing transparencies

lp -o media=Transparency <file>

lp -o media=Transparency <file>

Printing with stapling (see note 1) - only printer jcolor and k

lp -d jcolor -o StapleType=StapleON -o StaplePos=1PLU <file>

lp -d jcolor -o Duplex=None -o StapleType=StapleON -o StaplePos=1PLU -o sides=one-sided <file>

Printing booklet - only printer jcolor_booklet

lp -d jcolor -o BindMode=SaddleStitch -o Duplex=None -o Booklet=Left -o print-color-mode=Color <file>

lp -d jcolor -o PageSize=A5 -o BindMode=SaddleStitch -o Duplex=None -o Booklet=Left -o Finishing=Col -o print-color-mode=Color paper.pdf

Note 1: Pay attention on combining copies and stapling. If you like to print a PDF (e.g. 4 pages) 10 times, do NOT use the -n <number> parameter. The whole printjob, 4 pages * 10 copies, will be stapled together (only one)!

Solution: Use the 'Repeat Job' option in the advanced tab of the print dialog.