[Desktop_printing] PPD settings vs IPP options

Michael Sweet mike at easysw.com
Thu Feb 9 06:33:45 PST 2006

Alexander Larsson wrote:
> I'm starting to look at the Gtk+ print dialog, and I have some questions
> about how things are supposed to work.
> ...
> 1) Get the PPD file for the printer, use the PPD file to set up the UI
> ...
> 2) Get IPP attributes for the cups printer (media-supported,
> ...
> Is one way preferable over the other in any way? Does it ever make sense
> to mix these different methods?

As others have pointed out, the correct answer is 3:

     3) Get the PPD file for the printer, use the PPD file to setup the
        UI and then pass the PPD option selections as IPP attributes.

> It seems to me that using the PPD file allows higher fidelity in the UI
> (with UIConstraints and things like that) and allows printer-specific
> features. So, IMHO it looks like a better choice, but I don't know all
> the details here.

Correct, however...

> The PPD method only seems to work if you use postscript files though.
> How would this work if we used e.g. PDF as the spool format?

You don't embed the PostScript option code in the file you are
printing, you specify them as IPP attributes when you submit the
job.  The simplest way to do this is to use the CUPS API function
cupsPrintFile() and pass in a cups_option_t array with all of your

Alternatively, you can put the options in the PostScript page header:

     %cupsJobTicket: option=value option=value ...
     %cupsJobTicket: option=value option=value ...

However that only works for PostScript files.  Presumably we will
end up with a way to do this in PDF files, too, after the next
printing summit...

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

More information about the Printing-summit mailing list