开发者

Exception on printing: The device is not ready

开发者 https://www.devze.com 2022-12-18 20:28 出处:网络
I have a report document created by Microsoft Reporting but instead of using its viewer to show the document and print it, I used Pr开发者_JAVA百科intDocument class to print it directly without showin

I have a report document created by Microsoft Reporting but instead of using its viewer to show the document and print it, I used Pr开发者_JAVA百科intDocument class to print it directly without showing user any windows.

It worked perfectly until I installed a thermal printer and disabled its Spooler. Now once in a while i receive a Win32Exception indicating "The Device is not ready". I suppose this is because of the Spooler which I have disabled but because of a problem with the printer, I cannot enable it.

So, am I right about the problem? If so, is there anyways to check the printer before sending the print command?


The PRINTER_INFO_2 structure returned by GetPrinter() should return the printer status. The Microsoft Knowledgebase Article "How to get the status of a printer and a print job" includes example code written in C.

0

精彩评论

暂无评论...
验证码 换一张
取 消