ctalkington / python-ipp

Asynchronous Python client for Internet Printing Protocol (IPP)
MIT License
36 stars 20 forks source link

Support for "sides" job-attribute-tag for double-sided printing #590

Open pkuppens opened 4 months ago

pkuppens commented 4 months ago

Problem:

The document I try to print double-sided comes out of the printer single-sided.

What I tried:

When executing the PRINT_JOB, where I added the following to the message:

            "job-attributes-tag": {
                "sides": "two-sided-long-edge",
            }

What I saw:

I note that the output is NOT double-sided

Analysis:

I checked the output of get-printer-attributes, and it contains:

      "sides-default": "one-sided",
      "sides-supported": [
        "one-sided",
        "two-sided-long-edge",
        "two-sided-short-edge"
      ],

In the debug logging when I execute the print_example, I see: 2024-07-12 11:19:34,960 - pyipp.serializer - DEBUG - Unknown IppTag for sides

Code inspection:

Indeed, src/pyipp/tags.py does not contain "sides" in the ATTRIBUTE_TAG_MAP

So I think the problem is caused by not completely serializing the request.

Suggestion/Request

Note

While I feel comfortable programming in Python, I'm also new to IPP and this library. I would gladly contribute to this library but require some pointers for a high-quality solution.