[Printing-architecture] GTK Print Dialog: Modern IPP printing environments cause problems

Till Kamppeter till.kamppeter at gmail.com
Wed Jul 29 16:13:06 UTC 2020


On 29/07/2020 17:35, Marek Kasik wrote:
> 
> Yes, it does an IPP request on the printer for these attributes:
> 
>      "printer-name",
>      "printer-uri-supported",
>      "member-uris",
>      "printer-location",
>      "printer-info",
>      "printer-state-message",
>      "printer-state-reasons",
>      "printer-state",
>      "queued-job-count",
>      "printer-is-accepting-jobs",
>      "job-sheets-supported",
>      "job-sheets-default",
>      "printer-type",
>      "auth-info-required",
>      "number-up-default",
>      "ipp-versions-supported",
>      "multiple-document-handling-supported",
>      "copies-supported",
>      "number-up-supported",
>      "media-col-default",
>      "media-col-supported",
>      "media-default",
>      "media-size-supported",
>      "media-supported",
>      "media-left-margin-supported",
>      "media-right-margin-supported",
>      "media-bottom-margin-supported",
>      "media-top-margin-supported",
>      "sides-default",
>      "sides-supported",
>      "output-bin-default",
>      "output-bin-supported"
>

You could simply try "all" and "media-col-database", this is what

/usr/share/cups/ipptool/get-printer-attributes-2.0.test

does. This is also what I do in libcupsfilters so that "driverless" and 
cups-browsed can create PPDs.

> Gtk has its own http-based facility to handle IPP requests so it does 
> not call CUPS API for this.

Why that, is it not easier to simply use libcups? What is the specialty 
of this code and where is it located in the source code of GTK?

> The URI is composed of protocol, address, port and resource path of the 
> discovered printer now.
> 

OK, should be correct. Please compare with CUPS output ("lpstat -l -e", 
"lpinfo -l -v").

> However, for the temporary queues there is an issue. How to get names 
> and URIs of those printers without calling the cupsEnumDests()? I can 
> emulate the way the CUPS creates them from the Avahi data but it would 
> be better to get those via an IPP operation.

You probably mean the CUPS URIs to talk to the temporary CUPS queues, as 
the device URIs of the physical printers are derivable from the DNS-SD 
record (protocol://host:port/TXT-"rp"-field). The CUPS URI is always 
ipp(s)://cups-host:cups-port/printers/queue-name. So you have to find 
the correct queue name here, which would match the output of "lpstat 
-e". Best is to check through the source code of CUPS, this is what I do 
in such cases, but AFAIK it is the DNS-SD service name with each group 
of non-alphanumeric characters replaced by a single '_', no change in 
upper/lower case and no removal of a trailing underscore (Michael, am I 
right? Which function in the CUPS source does this?).

    Till


More information about the Printing-architecture mailing list