[cups.development] cupsFilter need to parse PPD file to get user

Kurt Pfeifle k1pfeifle at gmx.net
Tue Dec 21 05:22:36 PST 2004


On Tuesday 21 December 2004 00:24, anonymous wrote:

> I'm writing my own *cupsFilter. Do I have to parse both the ppd file and the 
> user option list to support all user options?

That depends.

It depends entirely upon what your cupsFilter is supposed to do. A drop-in 
replacement for any other filter? An additional downstream-filter, that 
processes the result of the previious filters? Actual manipulation of the
visual appearance of the printed image on the paper? Or just some other
stuff?

But you don't tell what your filter is supposed to do, so you can be given
detailed advice.

Be aware that your naming it "*cupsFilter" seems to imply that you want
to enumerated it as such in the printqueue's PPD. That also implies that
your filter will be the *last* in the CUPS filtering chain. After this 
filter the job goes straight to the backend, and then to the printer.

Saying it is the "last" filter, doesnt tell us how many, and which filters
come before yours. It doesnt tell us which mime-type it likes to take as
input. It doesnt tell us how you set up your mime.convs file for that
mime.type either.

> After setting up queue options and print a test page, command line arguments 
> #6 (options) to the filter is an empty list. 

Are you sure you started to count from "$0" (the filter itself), via "$1" 
(the first parameter, which is the job-id), through to "$5" (the job options)
and "$6" (the optional file to be processed, otherwise it is stdin to be
processed)?

> So I suppose I have to parse  
> PPD file to get options.
> 
> User might submit job through command line and overwrite options set in PPD 
> file, so I have to parse that as well?

It depends.

> How about kprinter. I saw some strange options like orientation-requested=4 
> multiple-document-handling=separate-documents-collated-copies, how am I 
> supposed to do with it?

Please read about the IPP specifications, as laid down in the IPP RFCs.
"orientation-requested" and "multiple-document-handling" are official IPP 
job attributes.

CUPS understands all (or nearly all?) IPP job attributes and supports most
of the values they can be given.

> Thanks 

Cheers,
Kurt





More information about the cups-devel mailing list