This site requires JavaScript to be enabled

Notifications

Printing Duplex via LPR on Khoury Linux machines

30 views
How to print Duplex using Cup's version of LPR. These steps have been tested on a Linux machine. Note: This document explains the use of the lpr command on a system which has already been set up to print to our printers. For instructions on setting up a machine to print to our printers in the first place, see the tutorials available on our Printing page. Khoury Systems-managed Linux and Windows machines come with printing pre-configured.

Using lpoptions to get available printer settings

[myaccount@login] [~] lpoptions -h print -p printername 
 
media=Letter sides=one-sided finishings=3 copies=1 job-hold-until=no-hold job-priority=50 number-up=1 auth-info-required=none job-sheets=none,none printer-info=printername printer-is-accepting-jobs=1 printer-is-shared=1 printer-location='310 WVH' printer-make-and-model='HP LaserJet 2200 Foomatic/hpijs' printer-state=3 printer-state-change-time=1257875748 printer-state-reasons=none printer-type=36884
 
Format: lpoptions -h <print server> -p <printer> 
 
These options get you the current settings of the printer you specify.

Using lpoptions to get the list of printer options that can be set

[myaccount@login] 
[~] lpoptions -h print -p printername -l 
 
PrintoutMode/Printout Mode: Draft *Normal High InputSlot/Media Source: *Default PhotoTray Upper Lower CDDVDTray Envelope LargeCapacity Manual MPTray PageSize/Page Size: Custom *Letter A4 Photo Photo5x7 3x5 5x8 A5 A6 B5JIS CDDVD80 CDDVD120 Env10 EnvC5 EnvC6 EnvDL EnvISOB5 EnvMonarch Executive FLSA Hagaki Legal Oufuku w558h774 w612h935 PageRegion/PageRegion: Custom Letter A4 Photo Photo5x7 3x5 5x8 A5 A6 B5JIS CDDVD80 CDDVD120 Env10 EnvC5 EnvC6 EnvDL EnvISOB5 EnvMonarch Executive FLSA Hagaki Legal Oufuku w558h774 w612h935 Duplex/Double-Sided Printing: DuplexNoTumble DuplexTumble *None Quality/Resolution, Quality, Ink Type, Media Type: *FromPrintoutMode 300DraftGrayscaleK 300GrayscaleK 600GrayscaleK
 
Format: lpoptions -h <print server> -p <printer> -l 
These options will get you a list of options you can set via the command line. These lines can be deciphered as:
Name of Option/As the GUI Shows it:Possible Options (with * denoting the current default)

Using grep to get only the options you care about

[myaccount@login] 
[~] lpoptions -h print -p printername -l | grep uplex 
Duplex/Double-Sided Printing: DuplexNoTumble DuplexTumble *None
 
This lets us pick out the Duplexing options out of the others that we may not care about. In this case the option name is "Duplex" and is currently set to "None".

Using the newly found option to print Duplex

[myaccount@login] 
[~] lpr -Pprintername -o Duplex=DuplexNoTumble test.txt
 
We take the option that we learned previously, and set it by adding "-o Duplex=DuplexNoTumble" to the LPR line.