Which is the correct way to specify collate

Michael Sweet mike at easysw.com
Tue Jan 23 04:41:08 PST 2007


Anders Blomdell wrote:
>> Anders Blomdell wrote:
>>> With cups 1.2.7 (on fedora6 at least), top level collate has stopped
>>> working from kprinter and gtklp on printers that support collate. The
>>> reason is that the collate option exists in both the ppd file and in
>>> the cups interface, so my question is simply, should collate be
>>> specified with:
>>  > ...
>>
>> For printing jobs, use cupsAddOption.  ppdMarkOption() only marks the
>> option in the PPD file/data, which doesn't get applied to the job
>> unless you actually save your changes to the PPD file in
>> /etc/cups/ppd.
>>
> A follow-up question; we configure our printer(s) by giving the following command on the cups server:
> 
>   lpadmin -p Printer -o Collate=True
> 
> if I (or rather gtklp) does a:
> 
>   cupsGetOption("collate",act_printer->num_options,act_printer->options)
> 
> NULL is returned, while if I do a
> 
>   ppdFindMarkedChoice(printerPPD,"Collate")
> 
> 'True' is returned. If I then do a save (i.e. creating a ~/.cups/lpoptions), subsequent calls to:
> 
>   cupsGetOption("collate",act_printer->num_options,act_printer->options)
> 
> returns 'true' and calls to:
> 
>   ppdFindMarkedChoice(printerPPD,"Collate")
> 
> 
> returns 'True'.
> 
> Am I correct to assume that this means that 'ppdFindMarkedChoice' should be called to determine the preferred choice to use, and 'cupsAddOption' should be used for the actual printing?

 From an application, you need to combine the PPD defaults with the
user defaults from ~/.cups/lpoptions or /etc/cups/lpoptions.  Normally
we recommend using ppdOpenFile, ppdMarkDefaults, and cupsMarkOptions
to yield the composite "view" of the default options in the PPD file.

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Publishing Software        http://www.easysw.com




More information about the cups-devel mailing list