Show print progress

Show print progress

Forum member · Apr 28, 2023
I want to show the progress of the printing operation to the user with a progress bar and a label, like many PDF reader programs. For example, page 1 of 50 is being printed. How can I get the number of the page that has just started to be printed?

Re: Show print progress

Support · Apr 28, 2023
Hi , You can achieve your requirement by using Updated event of PrintJob object. Here is a code sample: private static void Job_Updated(object sender, PrintJobEventArgs e) { PrintJobStatus jobStatus= e.PrintJob.Status; int printedPage = e.PrintJob.PagesPrinted; if (jobStatus.ToString() == "Printing") { Console.WriteLine("Printing " + printedPage + " of " + e.PrintJob.Pages.Count); } if (jobStatus.ToString()== "Printed") { Console.WriteLine("Printed " + printedPage + " of " + e.PrintJob.Pages.Count); } } Thanks, ceTe Software Support Team

Re: Show print progress

Forum member · Apr 29, 2023
<PagesPrinted> always returns zero... The result of this line of code: Txt1.Text = ("PrintJob Updated: JobId = " & e.PrintJob.JobId & " PrintStatus = " & e.PrintJob.Status & " PagesPrinted = " & e.PrintJob.PagesPrinted) In the update event, it is like this: PrintJob Updated: JobId = 77 PrintStatus = 256 PagesPrinted = 0 Please advise ... thank you

Re: Show print progress

Support · May 1, 2023
Hi, The Status code 256 indicates that the print job page is deleted. Please refer to the PrintJobStatus Enum here . Regarding the PrintJob Update event, firing of the Update event depends on the printer being used. The PrintManager sends the print job to the spooler and monitors the job within the spooler itself. The printer has to return the status of the print job to the spooler and then PrintManager reads this status and fires the Update event accordingly. Some printers return the status for every page printed in which case the PrintJob Update event will fire and notify that a certain page is printed, some printers do not return the status for every page in which case the PrintJob’s Update event will not fire. It is normal for the PrintJob to not fire the update event for every page printed depending on the printer used. Thanks, ceTe Software Support Team