How to know print given to network printer is success
-
Hello All, I have called PrintDocument.Print() method to print given document. How to check given print is success or not. Regards, Sri
Normally, you don't. Normally, once your app prints it, your app shouldn't care at all about the job. The job may get hung up in the queue for various reasons, including being about 20th in line to print, none of which are the responsibility of your app to report. It may be an hour before the job actually makes it to paper, even if theres nothing wrong. Those conditions are left up to the printing system to report to the user, not your app. Normally... What is your app doing that you feel the need to know if the doc printed or not?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
Normally, you don't. Normally, once your app prints it, your app shouldn't care at all about the job. The job may get hung up in the queue for various reasons, including being about 20th in line to print, none of which are the responsibility of your app to report. It may be an hour before the job actually makes it to paper, even if theres nothing wrong. Those conditions are left up to the printing system to report to the user, not your app. Normally... What is your app doing that you feel the need to know if the doc printed or not?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...Thanks Dave, My application is printing checks. Before printing check number is saved to database. If print fails at any reason (Paper Jam,Paper Out,Not connected...etc) i nedd to update database with default check number "000000". Thats why i need print staus of check. Dave, Can you please give me idea to get the status.Please Thanks, Sri
-
Thanks Dave, My application is printing checks. Before printing check number is saved to database. If print fails at any reason (Paper Jam,Paper Out,Not connected...etc) i nedd to update database with default check number "000000". Thats why i need print staus of check. Dave, Can you please give me idea to get the status.Please Thanks, Sri
You'd have to get the information using the classes in the System.Printing[^] namespace. This is oknly available in .NET 3.0 and above. If you're using .NET 2.0 and below, you'd either have to use WMI and the System.Management namespace to do something like this, or implement printing directly to the printer without going through the print spooler. You can find an example of that here[[^](http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/35575dd8-7593-4fe6-9b57-
64ad6b5f7ae6/ "New Window")].A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...