I'm writing a Printer manager for my Internet cafe management software but unfortunately I've run into a brick wall.
Everything is working so far, my printer watch software written in Visual Basic happily picks up print jobs from the paused print queue. I can find the total number of pages of the document printed for everything I've tested so far. However, if I chose to print multiple copies of the same page, this seems to come up in the print job as only a single copy.
So for example if I type out a single line in notepad and print it, it will come out as 1 page on the print job and print out 1 page from the printer.
If I print out the same single line from notepad but set 'Copies' to 2, it still appears to be 1 page on the print job, but 2 pages will be printed out from the printer.
This is no good for me because I am still charging for only a single print when 2 copies have been printed!
My print watch software keeps the printer queue paused so I can't use 'PagesPrinted' even if it did provide the currect number of total pages printed.
Is there any way to find out how many copies were printed on a print job, as then I could just multiply 'TotalPages' by the number of copies to work out how many total pages there actually is.
The bit of code I'm using to look at print jobs is this:
Set colPrintJobs = objWMIService.ExecQuery ("Select * from Win32_PrintJob")
For Each objPrintJob in colPrintJobs
If I print out a single page document with copies set to 10, I want to know that 10 pages have been printed in total. Right now all I know is that a single page document has been printed but I can't see how many copies have been set.
None of the other columns on the Win32_PrintJob seem to show either the actual total number of pages or the number of copies - http://msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_printjob.asp