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
media
attribute. (e.g.Letter
) - Get the printer uri from the
printer-uri
attribute. (e.g.ipp://localhost/printers/MyPrinter
) - Get the printer name by passing the printer uri to the
IPP_GET_PRINTER_ATTRIBUTES
operation and getting theprinter-name
attribute. (e.g.MyPrinter
) - Get the path to the PPD passing the printer name to the the
cupsGetPPD
method. - Open the PPD passing the path to the PPD to the
ppdOpenFile
method. - Get the paper size by passing the PPD and paper name to the
ppdPageSize
method.
This will work, but it seems a bit roundabout. Is there a more efficient way of getting what I need?