I am writing a tool that controls printers. I need to get the number of printed pages to work. I am using a printer event system (FindFirstPrinterChangeNotification, FindNextPrinterChangeNotification, ...).
I can get a DEVMODE structure with dmCopies value (JOB_NOTIFY_FIELD_DEVMODE). But this value is incorrect when Microsoft Word is used to print documents. This is due to a Word error (function). Word fixes this error using SP (http://support.microsoft.com/kb/919736/en-us). But SP can not always be installed on the system.
How can I get the correct dmCopies value?
One solution is to read the spool files (SPL) and get the correct DEVMODE structure from them. But for this, it is necessary to support the formats of RAW printers (PCL, PostScript, ESC-P, CaPSL, Prescribe, ...) (since some printers only generate spool files in RAW).
Maybe someone knows a different solution?
source
share