c++winapiprint-spooler-api

When job is printed, last job status is JOB_STATUS_PAUSED, instead of JOB_STATUS_PRINTED


I poll printer queue on any change like JOB_CHANGE, and if I see that some job disappeared, I report to server that job has been printed or deleted, according to job last status.

Problem is that the printer Kyocera M3550 returns as the last status JOB_STATUS_PAUSED, but no JOB_STATUS_DELETED or JOB_STATUS_PRINTED.

These are the statutes I get in ascending order:

What does that mean? I can't relay on the JOB_STATUS_PASUED as my last status because it is possible that someone preformed this intentionally.


Solution

  • It may be that the Kyocera printer has its own print processor which is setting print jobs to a paused state before deleting them. In that case, you can still detect the deletion by the fact that the job disappears. Obviously, you'll have to keep a list of ongoing print jobs in order to detect deletions in this manner.

    When the print job first appears, you should call the GetJob function with the Level parameter set to 2 and pass a JOB_INFO_2 struct to be filled in. The JOB_INFO_2 struct will provide all the information about a print job that's available.