Windows programmable virtual printer “device”

馋奶兔 提交于 2019-12-11 14:24:11

问题


I have no idea how this windows service called or how should I tag it. But I have seen around some software driven printing devices/configurations at windows, like Send to OneNote or Convert to PDF (from different pdf applications).

So I want to create one like this myself, lets say a virtual printer device that converts documents into PDF file.

How it called? Where I can find some information about it ?

Thank you.


回答1:


A lot of these applications (on Windows) actually use the built-in Windows PostScript printer driver to produce a PostScript program from the application.

That is then sent to a virtual printer (in versions of Windows before Windows 10, a Port Monitor is used) which stores the program on disk. It then starts up a PostScript interpreter which is capable of creating a PDF file from a PostScript file. Notably these include Adobe Acrobat Distiller, the JAWS PostScript interpreter and Ghostscript. Because Ghostscript is open-source, it is probably the most widely used.

The alternative approach is to write a printer driver. This needs to accept OS native drawing operations (which differ according to the operating system) and then produce PDF equivalents for those drawing operations, and wrap the whole thing up as a PDF file.

The first solution is easiest, because it leverages the work other people (the OS vendor and the PostScript interpreter vendor) have done. The latter is, I think you'll find, much harder.

Of course, since Windows and MacOS can both now produce PDF files, it seems somewhat redundant to implement these now.



来源:https://stackoverflow.com/questions/50078444/windows-programmable-virtual-printer-device

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