Dynamically assign print tray

Helge Blischke h.blischke at srz.de
Wed Jan 25 08:59:18 PST 2006


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 ...

-- 
Helge Blischke
Softwareentwicklung
SRZ Berlin | Firmengruppe besscom
http://www.srz.de




More information about the cups mailing list