python-ipp icon indicating copy to clipboard operation
python-ipp copied to clipboard

Add media and center-of-pixel attributes tags to map

Open so-saf opened this issue 5 months ago • 0 comments

The "media" attribute is used to specify the page size, for example media=iso_a4_210x297mm. Type supplied according to https://datatracker.ietf.org/doc/html/rfc8011#section-5.2.

The "center-of-pixel" attribute is a flag that tells Ghostscript in CUPS how to render PostScript or PDF files. You can read a little more here https://github.com/OpenPrinting/cups-filters.

Usage example:

async with IPP("ipp://localhost:631/printers/my-printer") as ipp:
    response = await ipp.execute(
        IppOperation.PRINT_JOB,
        {
            "operation-attributes-tag": {
                "requesting-user-name": "Me",
                "job-name": "My Test Job",
                "document-format": "application/pdf",
                "media": "cusom_40x20mm_40x20mm",
                "center-of-pixel": True,
            },
            "file": content,
        },
    )

so-saf avatar Aug 27 '24 20:08 so-saf