python-ipp
python-ipp copied to clipboard
Add media and center-of-pixel attributes tags to map
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,
},
)