i'm trying to pause a print job once i print a document. but the problem is the printer will still continue even it says Paused.
i have an event log listener that would check for Microsoft-Windows-PrintService/Operational logs and my code would trigger once it detects event id 800 or Spooling Job id#.
here's my code for pausing the job, it pauses but still the document is being printed even it says paused.
private void EventWritten(Object obj, EventRecordWrittenEventArgs arg)
{
PrintQueue myPrintQueue = new PrintQueue(ps, printer, PrintSystemDesiredAccess.AdministratePrinter);
foreach (var job in myPrintQueue.GetPrintJobInfoCollection())
{
job.Pause();
}
}
on EventID 308, it says i successfully paused
Document 29, Print Document owned by --- was paused on HP DeskJet 1110 series. This document will not print until the document owner resumes the print job. No user action is required.
can anyone help on how i can prevent printer to start printing?
EDIT: it pauses jobs that are heavy in size or multi-paged, else it will go straight to printing even if paused.