简体   繁体   中英

In C#.net, How I get the Content of File Sent to Print to normal office printer

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.

File contains only text data . Not images

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

Thanks in advance.

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

and Print Spooler Monitor

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM