Xprint should support use of the OpenPrinting spooler API (aka PAPI) for
communicating with print spoolers in a more robust fashion than the current
method of opening pipes to a variety of lp* commands and trying to parse the
Debian supports the implementation of this feature.
Ha ha, doesn't that sound officious? I mean I support implementing PAPI. It
will in one hit deal with a number of limitations that Debian users frequently
gripe over, namely:
- dynamic listing of printers (running xprehashprinterlist each time the list
changes is not so convenient)
- dynamic reading of printer properties, in particular printer resolutions
(one user has already reported using several different printers simultaneously,
which makes the standard solution of setting *default-printer-resolution more
difficult than we want)
- identifying the default printer
By the way, the name "PAPI" is a little unfortunate due to name-clashes with
http://papi.rediris.es/ and http://icl.cs.utk.edu/papi/. But that's not
I'm on record (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=291402) offering
a six-pack of beer to the first person to get this done.
I've got a test program that gets PAPI working. I'm using the PAPI
implementation from http://sourceforge.net/projects/openprinting/, in particular
I used the CUPS implementation, papi-lib-cups.
I used the API from http://www.openprinting.org/
Following the examples in the pdf document, it was reasonably straight forward
to get a list of all printers, and printer out the values of all printer
attributes (include multiple values).
The API does not give you a count of the number of printers found, or the number
of attributes. You've just got to go through them one by one.
There are currently two problems, in terms of what we want for Xprint:
1) resolution values are not returned.
The API expects "printer-resolution" to be one of the printer attributes, and
provides PAPI_RESOLUTION facilities. But, amongst the two dozen odd
printer attributes returned, "printer-resolution" is not among them.
2) default printer is not identified
The API provides a filter (PAPI_PRINTER_DEFAULT) to only return the default
printer. But when it is used, nothing is returned. I think I was using the
I suspect these are just bugs in the libpapi implementation, since it is new and
not heavily worked upon. The internal code gets PAPI resolution data from
libcups, so it's possible libcups is not cooperating instead.
I won't attach the program yet since it's not Xprint specific, it's just a
simple test case. Maybe when these bugs are cleared, it will be worth posting
the test code.
*** Bug 408 has been marked as a duplicate of this bug. ***
Closing WONTFIX because nobody cares about Xprint. Reopen if you plan to address this bug.
Once more, with feeling. Apologies for the spam.