[cups.development] Python API For Converting Model Name into the Location of the PPD file

Tim Waugh twaugh at redhat.com
Fri Mar 20 03:20:32 PDT 2009


Bin Li wrote:
> Is there a python API or C API to convert the human-readable model name into the location of the PPD file in CUPS? For instance, it takes 'HP LaserJet 2410' as an input and converts it into '/usr/share/cups/model/foomatic-db-ppds/HP_LaserJet_2410.ppd.gz'

Often when I've been asked questions like this it has turned out to be 
the wrong question.  What exactly are you trying to do -- what's the 
problem you're trying to solve?

For instance, is it that you are trying to find a PPD for a particular 
printer that has been plugged in?  If so, it would be better to use the 
IEEE 1284 Device ID to match against, in which case you really want to 
try to match the ID first.

The basic method of matching is to use a CUPS-Get-PPDs IPP request, and 
there is a C API for this in libcups (and a Python API in pycups). 
However, depending on your requirements you may have to filter through 
the resulting list of PPDs to find the "best" one for your needs.  There 
may be several PPDs that match a particular printer model, corresponding 
to different drivers that are able to drive it.

Tim.
*/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
URL: <https://lists.cups.org/pipermail/cups/attachments/20090320/64a75cc4/attachment.bin>


More information about the cups mailing list