How to get the original full file path been printed by Spooler API

只愿长相守 提交于 2019-11-30 09:41:44

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/4236762/how-to-get-the-original-full-file-path-been-printed-by-spooler-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!