如何获得Spooler API打印的原始完整文件路径 [英] How to get the original full file path been printed by Spooler API

查看:215
本文介绍了如何获得Spooler API打印的原始完整文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用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.

推荐答案

如果您要查找原始文档路径(例如,刚刚打印的Word Document的位置),则后台打印程序将无法告诉您这一点.

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.

假脱机程序通常通过GDI或XPS路径接收文件.进行打印的应用程序有效地(通过适当的设备驱动程序)向后台打印程序发送了一系列图形命令,后台打印程序服务将在发送到打印机之前将其缓存到一个临时文件中.这意味着假脱机程序本身对原始源文件或其所在位置一无所知.

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.

如果您想知道后台打印程序如何获取文档名称,可以通过StartDoc调用来完成,该调用将传递

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.

这篇关于如何获得Spooler API打印的原始完整文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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