[cups.general] Getting capability info from IPP printers

Michael Sweet msweet at apple.com
Wed Feb 20 11:59:58 PST 2013


Till,

Assuming this is all for IPP printers, you should be able to do this:

    cups_dest_t mydest = { "somename", NULL, 0, NULL };

    mydest.num_options = cupsAddOption("printer-uri-supported", "ipp://printer-address/printer-path", 0, &mydest.options);

    cups_dinfo_t *mydinfo = cupsCopyDestInfo(CUPS_HTTP_DEFAULT, &mydest);

    // do something with mydest and mydinfo

    cupsFreeDestInfo(mydinfo);
    cupsFreeOptions(mydest.num_options, mydest.options);

Also you can use cupsAddDest to manage a list of destinations; the key bit is to have "printer-uri-supported" point to the printer - no local queue is required for these functions to work, the local queue just provides support for spooling and conversion.

Reminder: the current code is optimized for IPP Everywhere/CUPS implementations so it is entirely possible you will run into issues if you try to print to a "lesser" implementation of IPP...  Query stuff should work just fine, though.


On 2013-02-20, at 1:21 PM, Till Kamppeter <till.kamppeter at gmail.com> wrote:

> On 02/20/2013 07:02 PM, Michael Sweet wrote:
>> The discovery APIs are designed to only find CUPS and IPP Everywhere-compatible printers at this time, although conceptually they could be made to find others (including maybe statically-configured printers in ~/.cups?)
>> 
>> All of the destination APIs will work with any IPP printer - just create a CUPS destination and set the printer-uri-supported value in the options array to have them look at the specific printer you are using.
> 
> This means that I have to create a local (raw) CUPS queue at first, set
> the URI pointing to the printer, and then I can investigate the printer.
> After that I either generate and add a PPD (IPP Everywhere printer), do
> nothing (remote CUPS queue), or remove the queue again (unknown
> printer). Is this the correct way to proceed?
> 
>   Till
> 
> _______________________________________________
> cups mailing list
> cups at easysw.com
> http://lists.easysw.com/mailman/listinfo/cups

_________________________________________________________
Michael Sweet, Senior Printing System Engineer, PWG Chair





More information about the cups mailing list