[英]Capture print errors with System.Drawing.Printing.PrintDocument
The application my team is working on is developed using WPF & ,NET 4.0. 我的团队正在使用的应用程序是使用WPF和.NET 4.0开发的。 The application also communicates with thermal printer connected to PC (like the ones used in malls, but its not a POS system).
该应用程序还可以与连接到PC的热敏打印机进行通信(类似于商场中使用的打印机,但不是POS系统)。 We only have 1 printer connected to the PC.
我们只有1台打印机连接到PC。
The application connect to printer and the output is often successful without any issues and parallel we save the data into the DB (SQL Server 2008 and going to SQL Server 2012). 该应用程序连接到打印机,输出通常会成功,没有任何问题,并且并行地,我们将数据保存到数据库中(SQL Server 2008,然后转到SQL Server 2012)。
On a very rare occasions the printout is not available but the data is saved to DB. 在极少数情况下,无法使用打印输出,但会将数据保存到DB。
Is there any way to check or capture the printer related issue when we face this type of problem? 遇到此类问题时,有什么方法可以检查或捕获与打印机有关的问题?
Thanks in advance. 提前致谢。
Please Check whether your drivers are up to date. 请检查您的驱动程序是否最新。 And use debugging to check whether an error occurs when executing the code.
并使用调试检查执行代码时是否发生错误。 for this you can use try catch blocks which throws exceptions.
为此,您可以使用引发异常的try catch块。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.