Does anyone know if it is possible to hold a print job with help of Microsoft Print Spooler API?
I would like to hold it before it is sent to the printer.
Is this possible?
Does anyone know if it is possible to hold a print job with help of Microsoft Print Spooler API?
I would like to hold it before it is sent to the printer.
Is this possible?
If you're using AddJobW() and ScheduleJob() then yes.
AddJobW() creates the job and ScheduleJob() triggers it to start. (For sample code see here.)
So...
This depends on how much control you have over the print process. The SetJob command does allow you to pause an individual job but you would need to get in before any data is potentially sent out the port to a printer.
When an application prints a job the normal print path goes somthing like
If you can get the SetJob command in before the first WritePrinter path you will be able to pause the job prior to any data being sent to the device.
Unfortunately if you are using somthing like the C# PrintDocument class it obscures most of this and does not provide any way of getting the JobId parameter and printer handle that you would need to call the SetJob command.