[cups.general] Querying paper size dimensions and margins from IPP printers

Michael Sweet msweet at apple.com
Mon Jan 28 08:35:50 PST 2013


Till,

On 2013-01-28, at 10:55 AM, Till Kamppeter <till.kamppeter at gmail.com> wrote:
> On 01/28/2013 03:14 PM, Michael Sweet wrote:
>> You want to ask for the media-col-database attribute, which gives you all of the supported combinations of size, margins, type, etc.
>> 
>> If that fails, you can ask for media-size-supported (list of all supported dimensions and ranges of dimensions for custom/roll sizes), media-type-supported, etc.
>> 
>> Typically what you want to do it just include requested-attributes="all","media-col-database" to get everything.
>> 
>> (media-col-database is not returned by default for performance reasons, per PWG 5100.3)
>> 
> 
> When I do this I get more than 200 entries for a printer with ~20 supported paper sizes and two trays. Are these all possible combinations of paper sizes, paper types, and trays?

Yes - you'll normally get "number-sizes * number-sources * number-types" values for media-col-database, sometimes more if the printer supports things like media-color, media-weight, etc.  This is why you have to ask for media-col-database directly - it is, by far, the largest attribute in IPP.

> Are the units always 100th of a mm?

Yes, always.

> Is the only way to associate the paper size names, like "iso_a4_210x297mm", with the dimensions in the "media-col-database" via the size stated in the paper size name?


Generally yes, although some printers also support the media-size-name member attribute that provides the PWG media name for the dimensional size.  Also, roll and custom media sizes are reported using rangeOfInteger (IPP_TAG_RANGE) values instead of integers (IPP_TAG_INTEGER).

There is also private API in libcups to map to/from PWG names, PPD names, and dimensional sizes.  We use this internally in CUPS to support media-col for media selection.

_________________________________________________________
Michael Sweet, Senior Printing System Engineer, PWG Chair





More information about the cups mailing list