How to intercept data being sent to a printer?

心不动则不痛 提交于 2019-12-01 13:38:38

问题


I'm interfacing with an application that's sending a raw printer file to the default printer. This is the only thing it will do with the data.

I need to get this file somehow so I can store it elsewhere instead. What would be the best way to do this?

The best I've thought of is to write an app that listens to a specific port, and set the default printer to that port.

Would this way work? Is there a better way?


回答1:


I ran across and LDP implementation for Java that I'm going to modify and use. You can access it as a printer and then do what you want with the raw files.

http://lpdspooler.sourceforge.net/



来源:https://stackoverflow.com/questions/5034340/how-to-intercept-data-being-sent-to-a-printer

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