从任何打印机捕获文档并将其存储为.pdf或.bmp [英] Capture documents from any printer and store them as .pdf or .bmp

查看:59
本文介绍了从任何打印机捕获文档并将其存储为.pdf或.bmp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个程序拦截我系统上任何驱动程序的打印作业(不是一个自定义程序),并将打印作业的内容存储为.pdf,.png或大多数类似.bmp。我对C#非常流利,但是我在这个
论坛上看到的所有库和片段都是

I need a program to intercept print jobs from any driver on my system (not a single custom one) and store the contents of the print job as a .pdf, .png, or most likey .bmp. I'm faily fluent in C#, but all of the libraries and snippets that I've seen on this forum either


  • A:Aren'正确实施但根本不起作用,或
  • B:他们的方法不包含与打印假脱机的实际内容相关的任何数据。

您知道的API或方法是否允许我访问所有传出的打印作业(我还可以单独遍历每个驱动程序)并将其内容转换为位图或pdf?如果您知道其他语言的任何解决方案,
如果需要,我可以尝试调整它们。谢谢。

Is there any API or method that you know of that will give me access to all the outgoing print jobs (I can also loop through each driver individually) and their contents to be converted into a bitmap or pdf? If you know of any solutions in other languages, I can attempt to adapt them if need be. Thanks.

推荐答案

此类应用程序可能有恶意,因此我不会提供代码

This kind of application can have malicious intent so I won't offer code to do it.

但是,如果您已经有代码来捕获打印假脱机内容,请注意大多数此类解决方案要求您设置"保留打印文档"。或类似选项  on"Advanced"打印机选项卡 属性...用于每台打印机。 (
是使用保留命令的其他人,但这些只适用于特定的打印机子集)

However, if you already have code to capture print spool content, note that most of such solution requires you to set "Keep printed document" or similar option on "Advanced" tab of printer properties... for each printer. (There are others that make use of retention command, but these are only applicable to specific subset of printers)


这篇关于从任何打印机捕获文档并将其存储为.pdf或.bmp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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