捕获每个打印作业的.prn文件 [英] Capturing .prn file for each print job

查看:119
本文介绍了捕获每个打印作业的.prn文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去几天我用Google搜索了很多答案,但我找不到任何答案。



问题陈述:



我想在不提示用户的情况下为每个打印作业保存.prn文件。但我的问题不仅限于特定的打印机。我想捕获通过我的电脑上的任何打印机打印的每个文件的.prn文件。我想在我的C#应用​​程序中集成此功能。



任何帮助,指导,链接或示例代码都将受到高度赞赏

I have googled alot for the past few days to find an answer but i am unable to find anything.

Problem Statement:

I want to save a .prn file for each print job without prompting the user. but my problem is not restricted to a particular printer. I want to capture the .prn file for each file that is printed through any printer on my pc. I want to integrate this functionality in my C# application.

Any help, guidance, links or sample codes will be highly appreciated

推荐答案

您最有可能需要挂钩到假脱机服务器以执行您想要的操作。



此CodeProject文章介绍了如何执行此操作。

API挂钩显示 [ ^ ]



更具体地说,您需要查看 spoolsv.exe spoolss.dll 内的方法gdi32.dll



这是打印机功能列表

打印后台处理程序API函数 [ ^ ]



祝你好运。
You most likely need to hook into the spool server in order to do what you want.

This CodeProject article describes how to do it.
API hooking revealed[^]

More specifically you need to look into methods inside spoolsv.exe, spoolss.dll and gdi32.dll

Here is a list of printer functions
Print Spooler API Functions[^]

Good luck with the coding.


如果将FileSystemWatcher附加到%SystemRoot%\ SYSTEM32 \ SPOOL \ PRINTERS
What if you attach a FileSystemWatcher to %SystemRoot%\SYSTEM32\SPOOL\PRINTERS

这篇关于捕获每个打印作业的.prn文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆