how to get a physical printer status before printing job is sent?
I have a rather unusual problem. I am using xpdfprint binary for the print job from my application. But if the user has a "directly print to the printer" setting enabled and by mistake if the printer is not available (power failure or cord not plugged in) then the application hangs. It seems to be a standard behaviour since in my machine other windows applications also behave the same way. Problem is, in this case the printer timeout is not happening, neither it returns an error. It is waiting on the synchronous call to finish the printing. Is there anyway I can handle this situ开发者_StackOverflow社区ation? I am forced to find a solution because of a demanding customer. If by some means I get the physical printer status before the printing job is sent, I could solve this problem to an extent. Mine is a windows application and the coding is largely done in C#. If anybody has a win32 sample code please share with me.
Thanks in advance for any kind of help.
If the printer isn't connected then don't have a print menu item enabled, with a message.
Then, you just check every so often on the status.
You may find this of interest to check the status: http://www.codeproject.com/KB/printing/printeroffline.aspx
精彩评论