The class PrintDocument print asynchronously, however I need to check at the time of printing whether printing was successful. I'm doing by checking the print queue but the Print() method is asynchronous and not always have the correct information. Have tried using the OnEndPrint and OnPrintPage events and nothing. Any idea?
Asked
Active
Viewed 2,309 times
3
-
Are you trying to know when your program finished sending data to the printer? Or when the printer has actually, physically printed? – bland Apr 10 '14 at 12:52
-
PrintDocument does *not* print asynchronously. Its Print() method does not return until the document is submitted to the spooler. Tinkering with PrintQueue is a fail whale, most printer drivers submit the job too fast for you to see it. It is meaningless anyway, the printer slurping the document does not in any way guarantee that it will actually successfully print the document. A user fumbling with a paper jam or a toner cartridge is usually enough. And nothing you'd ever want to support. Look at the printer manufacturer for some kind of "management" software. – Hans Passant Apr 10 '14 at 13:09