Navigation

8/19/2014

Applescript: lpadmin command to set duplexing

Wanted to use LPADMIN command to turn on duplexing when I installed printers, I am using Generic PCL printer driver, version 1.3


First use this command to get options:
lpoptions -p printer_name -l
 
This returned:
 
PageSize/Media Size: *Letter Legal Executive Tabloid A3 A4 A5 B5 EnvISOB5 Env10 EnvC5 EnvDL EnvMonarch
Resolution/Resolution: *300dpi 600dpi
InputSlot/Media Source: *Default Tray1 Tray2 Tray3 Tray4 Manual Envelope
Duplex/2-Sided Printing: *None DuplexNoTumble DuplexTumble
Option1/Duplexer: *False True
 
 
So need to add this to lpadmin commandline:
-o Duplex=DuplexTumble -o Option1=True 
 
Full statement is:
do shell script "/usr/sbin/lpadmin  -L 2nd-floor-library    
 -o printer-is-shared=false  -o Duplex=DuplexTumble -o Option1=True 
 -p  '2nd-floor-library' -v smb://testserver.someplace.edu/LAW228_HP600 -P   
 " & quoted form of (POSIX path of myFile) as text & "  " 
 


This does not make double sided printing the default, rather it makes sure the option is not grayed out, and that 2 sided printing can be selected.

No comments:

Post a Comment