在C#.NET,我怎么得到的文件发送到打印普通办公室打印机的内容发送到、打印机、办公室、普通

2023-09-05 04:13:26 作者:一曲离殇、淡漠了谁的流年

一个文件发送到打印,和我要存储文件的内容在一个记事本文件。意味着我要维护的打印记录,即的文件和放大器;该文件的内容是由seprate记事本或Word文档的打印机上打印。

A file is sent to print,and I want to store the content of that file in a notepad file. Means I want to maintain A print Record, that which file & content of that file is printed by the printer in seprate notepad or any word document.

文件只包含文本数据。而不是图像

我是如何做到这一点。任何建议在C#.NET这样做。请分享一些code,这样我也能理解。

how I do this. Any suggestions for doing this in C#.Net. please share some code so that I can understand.

在此先感谢。

推荐答案

您可以监视使用FindFirstPrinterChangeNotification打印作业,这将有助于你得到工作有关的信息发射到像作业名称,状态,打印页,等打印机你可以参考监控打印机队列

You can monitor the print jobs using FindFirstPrinterChangeNotification , which will help you get information about the job fired to the printer like job name, status, pages printed, etc. You can refer to Monitor Printer Queue

和后台打印程序监控

但是你不能保存作业的内容在文件中(很容易),为打印作业已经由打印机驱动程序处理,是后台处理程序准备就绪,将在原PCL / PJL /等格式。

However you cannot save the content of the job in a file (easily), as the print job has already been processed by the printer driver and is spooler ready and will be in raw PCL/PJL/other format.

只有这样,你可以捕捉的内容是通过编写自己的打印监控

The only way you can "capture" content is by writing your own print monitor