捕获要打印到图像文件中的打印作业
我是 Windows 打印机驱动程序的新手,希望得到有关以下内容的任何指示。
- 枚举为打印机(在 打印菜单,类似于打印为 PDF 文件)
- 捕获打印作业并对其进行编码 转换为 JPG 文件(例如)
我对 JPG 编码很满意,因为我正在考虑使用 ImageMagick 等开源工具。 但是我不知道从哪里开始枚举和打印内容。
顺便问一下,Microsoft WDM DDK 可以免费下载吗?
I am a novice to Windows printer driver, and would appreciate any pointers on the following.
- Enumerating as a printer (In the
print menu, similar to print to PDF
file) - Capturing the print job and encode it
into a JPG file (say)
I am comfortable with JPG encoding, as I am thinking of using open source tools like ImageMagick.
But I am not sure where to start the enumeration and printing stuff.
BTW, Is Microsoft WDM DDK available for free download?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Windows 驱动程序工具包可以在MSDN.com
我不是驱动程序专家,但曾从事打印机端口监视器工作(请参阅此 StackOverflow 问题)来捕获标准打印机驱动程序 (Postscript) 的输出,并使用 Ghostscript 将它们转换为 PDF 或 TIF(Ghostscript 在开源格式,还可以输出 JPG),这相当容易做到。
The Windows Driver Kit can be downloaded freely on MSDN.com
I'm no driver expert but have worked on Printer Port Monitors (see this StackOverflow question) to capture the output of standard printer drivers (Postscript) and convert them to PDF or TIF using Ghostscript (Ghostscript is available in an open source format, and can also output JPG) which is reasonably easy to do.
您应该使用 WMI 来枚举打印。
请参阅:http://www.codeproject.com/Articles/10539 /Making-WMI-Queries-In-C
要将所有打印作业捕获为文件,将打印作业捕获到 pdf 文件中更有意义,因为打印作业可能不止一页。为此,您需要在软件中包含 .pdf 库。尝试: http://libharu.sourceforge.net/
You should use WMI to enumerate prints.
See: http://www.codeproject.com/Articles/10539/Making-WMI-Queries-In-C
To capture all print jobs as a file, it makes more sense to capture print jobs into a pdf file, as a print job might be more than one page. To do so, you need to include in your software a .pdf library. Try: http://libharu.sourceforge.net/