I've got a CUPS job control file (these can be found at /var/spool/cups/cnnnnn). I need to get the actual dimensions of the print that was made.
This is the way I've figured out to do it:
- Get the paper name using the
mediaattribute. (e.g.Letter) - Get the printer uri from the
printer-uriattribute. (e.g.ipp://localhost/printers/MyPrinter) - Get the printer name by passing the printer uri to the
IPP_GET_PRINTER_ATTRIBUTESoperation and getting theprinter-nameattribute. (e.g.MyPrinter) - Get the path to the PPD passing the printer name to the the
cupsGetPPDmethod. - Open the PPD passing the path to the PPD to the
ppdOpenFilemethod. - Get the paper size by passing the PPD and paper name to the
ppdPageSizemethod.
This will work, but it seems a bit roundabout. Is there a more efficient way of getting what I need?