[cups-devel] cups-devel Digest, Vol 23, Issue 18

Michael Sweet msweet at apple.com
Wed Oct 28 19:31:50 PDT 2015


Kurt,

> On Oct 28, 2015, at 7:39 PM, pipitas <pipitas at gmail.com> wrote:
>> ...
>> The finishings attribute is an enumeration
> 
> 
> Yes, that's what the print device also replied when I queried it. However,
> looking at
> https://www.ietf.org/assignments/ipp-registrations/ipp-registrations.xml
> and searching for "staple-top-right" on that page, I find two lines,
> stating different things (??):
> 
>   finishing-template staple-top-right name(MAX) | type2 keyword [PWG5100.1]
> 
> and
> 
>    finishings 22 staple-top-right 1setOf type2 enum [RFC2911]

The finishing-template member attribute is used with the finishings-col (collection) attribute, which is the replacement attribute for finishings that provides much greater control.

The finishings attribute is an enum attribute (enums are integers with special meanings) that provides the "simple" controls for stapling, punching, etc.

> ...
> I'm confused now. Can you help to un-confuse me again? (Maybe I need to
> grokk the difference between "finishings" and "finishing-template" first,
> which I haven't yet...)

There are two ways to specify finishing operations.

The first/original way is using the finishings attribute, which is a simple enumeration of different operations: staple (4), punch (5), staple-top-left (20), etc.

The second/new way is using the finishings-col attribute, which is a "collection" attribute.  The finishing-template member attribute in that collection provides the same simple finishing operation names as the finishings attribute, but as a keyword (string) instead of an enum (integer). Additional member attributes allow for control over positions of staples, etc.

>> - ipptool is mapping the pre-standard vendor enum to its symbolic name
>> (cups prefix).
>> 
> 
> What exactly does this remark mean? What do you mean with "pre-standard
> vendor enum", what do you mean with "cups prefix"?

Every enum value has a corresponding symbolic name that is not sent over the wire, but is used for readability since remembering integers is not user-friendly.

Enum (integer) values are assigned; values defined in standards go from 3 to 0x3fffffff (2^30 - 1).  Values defined by vendors (i.e. Apple in this case) go from 0x40000000 to 0x7fffffff (2^30 to 2^31-1).  In this case the 'cups-xxx' values were eventually standardized but some printers implement both sets of values for backwards compatibility.

(that's one of the reasons why we prefer finishings-col over finishings: you don't end up with this mess as long as you start with sane names to begin with...)

>> Right now ipptool doesn't map symbolic names in the other direction
> 
> 
> Since I don't get the meaning of your previous remark, I also don't get
> this one.

When ipptool displays the value of the finishings-supported attribute, it converts the integer (enum) values to their symbolic (name) counterparts so you can easily see what the values are.  But currently it does not allow you to specify those names as values for the attribute, e.g.:

    ATTR enum finishings staple-top-left

currently does not work but will in the next CUPS release (changes are in TOT now... :)

> ...
> Can you please confirm (or negate+help me to correct), that the two ATTR
> lines:
> 
>       GROUP job-attributes-tag
>       ATTR keyword sides two-sided-short-edge
>       ATTR enum finishings staple-top-right
> 
> in my *.test file were basically correct?

Basically correct, but you really need to use the value "22" to specify staple-top-right:

    ATTR enum finishings 22

(at least until the next version of CUPS comes out or you build TOT...)

> And that the fact they didn't work may be either an ipptool-bug or a bug in
> the printer's IPP implementation?

ipptool bug/limitation.

_________________________________________________________
Michael Sweet, Senior Printing System Engineer, PWG Chair




More information about the cups-devel mailing list