Dynamically assign print tray

st.graf st.graf at fz-juelich.de
Thu Jan 26 01:58:18 PST 2006


Helge Blischke wrote:
> Andrew wrote:
> 
>>Helge Blischke <h.blischke at srz.de> wrote in
>>news:23742-cups.general at news.easysw.com:
>>
>>
>>>Andrew wrote:
>>>
>>>>I am going to be writing a small program to print a batch of files
>>>>automatically. However, I need to select different trays on the fly
>>>>because of different paper formats. I have looked but have not found
>>>>command line arguements or APIs that allow me to pass a tray option
>>>>without manually reconfiguring the printer settings in CUPS
>>>>everytime. How can this be done?
>>>
>>>Usually the printer's PPD offers keywords for both tray selection
>>>and/or media type selection. You may easily use these keywords with
>>>the approrioate values as command line options (or access them via API
>>>functions).
>>>
>>>But, if you need to use different trays within a single job, you'd
>>>have to insert the appropriate PS snippets into the PS job.
>>>
>>>Helge
>>>
>>
>>Ok I looked through the PPD file and InputSlot is the configurable option.
>>However, I am not sure how to pass the argument through the command line to
>>the printing function (im currently using lp or lpr). If there another
>>command I should be using?
>>
>>-Andrew
> 
> 
> Well, if the PPD contains a line like
> 
> *InputSlot Upper/ Tray 1: "<</ManualFeed false /MediaPosition 3>> setpagedevice"
> 
> and you want to use this, then specify
> 
> -o inputSlot=Upper
> 
> as a command line option in the lp or lpr command (preceding the file name(s)).
> 
> Helge
> 
> PS: As for the IPP spec, case should not matter, but I'm not completely sure ...
> 

You may tray 'lpoptions -p <PRINTER> -l' to get all accessable options.

One of the output line is:
	InputSlot/Media Source: MPT *Tray1 Tray2 Tray3 EnvFeeder MF Auto
Tray1 is the default tray.
Now, I tried " lpr -P >PRINTER> -o InputSlot=MF /etc/motd " and it was 
printed on the ManualFeed-Paper.

Stephan




More information about the cups mailing list