简体   繁体   English

使用System.Drawing.Printing.PrintDocument捕获打印错误

[英]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.

相关问题 在WPF中使用System.Drawing.Printing.PrintDocument - Using System.Drawing.Printing.PrintDocument in WPF System.Drawing.Printing.PrintDocument慢 - System.Drawing.Printing.PrintDocument Is Slow 使用System.Drawing.Printing.PrintDocument在内存中生成PDF - Use a System.Drawing.Printing.PrintDocument to generate a PDF in memory 将 System.Drawing.Printing.PrintDocument 转换为 PDF c# - Convert System.Drawing.Printing.PrintDocument to PDF c# 可以将FixedDocument转换为Drawing.Printing.PrintDocument吗? - Can a FixedDocument be converted to a Drawing.Printing.PrintDocument? 如何跳过printDocument.print()中的打印对话框并直接打印页面? - How to skip the dialog of printing in printDocument.print() and print page directly? 用C#绘制和打印复杂文档(改进/替换我的PrintDocument) - Drawing and Printing complex document in C# (improving/replacing my PrintDocument) 使用System.Drawing.Printing将文件发送到打印无法正常工作 - Sending file to print not working using System.Drawing.Printing 使用PrintDocument打印到收据打印机不会打印所有内容 - Printing to receipt printer with PrintDocument does not print all content 除非用户登录到打印计算机,否则PrintDocument.Print速度很慢 - PrintDocument.Print is slow unless user is logged in to the printing computer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM