如何获取 Spooler API 打印的原始完整文件路径

发布于 2024-10-03 13:36:16 字数 81 浏览 0 评论 0原文

我想通过使用 Windows Spooler API 的独立程序来监视系统范围的打印作业,但只能获取打印作业的名称。如何获取带有完整路径的原始文件。

I want to monitor the system scope's printing jobs through a standalone program using the Windows Spooler API, but only the print job's name can be fetched. How do I get the original file with full path.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦言归人 2024-10-10 13:36:16

如果您正在查找原始文档路径(例如,您刚刚打印的 Word 文档的位置),后台处理程序将无法告诉您这一点。

假脱机程序通常通过 GDI 或 XPS 路径接收文件。执行打印的应用程序有效地向假脱机程序发送一系列图形命令(通过适当的设备驱动程序),假脱机程序服务将在发送到打印机之前将其缓存到临时文件中。这意味着假脱机程序本身不知道有关原始源文件或其位置的任何信息。

如果您想知道假脱机程序如何获取文档名称,可以通过 StartDoc 调用来完成,该调用将传入 DOC_INFO_x 结构。这是关于假脱机程序收到的有关源文档本身的所有信息。

If you are looking for the original document path (e.g. location of Word Document that you just printed), the spooler will not be able to tell you this.

The spooler generally receives files through the GDI or XPS paths. The application that does the printing effectively sends the spooler a series of graphical commands (via the appropriate device driver) which the spooler service will cache into a temporary file before sending to the printer. This means the spooler itself does not know anything about the originating source file, or where it is located.

If you are wondering how the spooler gets the document name, it is done via the StartDoc call that will pass in a DOC_INFO_x structure. That is about all the information that the spooler receives with regard to the source document itself.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文