问题
I want to write a driver for virtual printer (in C++ or Java) (As explained in How to create a virtual printer in Windows?) I would redirect the file to a file server (again as explained in http://www.colorpilot.com/VirtualPrinterForCSharp2.html.
What are the fundamental building blocks of a printer driver ?
I have read about spooler and print monitor but I am not sure that these are all that I have to know!
Any guide or suggestion appreciated in advance!
Regards
回答1:
Most print redirection requirements are fulfilled using a Port Monitor. You dont need to do a printer driver because if you do that then this is more difficult to broadbase across end-users who may want to use their printer drivers, you will need to have drivers for each printer and so on.
http://pages.cs.wisc.edu/~ghost/redmon/ is a very good example of a redirection port monitor. Mostly written in C. Please look at the licensing agreements before you see how you can use it in your project.
There is also a sample port monitor in the Windows WDK (Windows Driver Kit) you could use a base reference.
Hope this helps. If so, please vote a +1 :)
来源:https://stackoverflow.com/questions/4640287/how-to-write-a-driver-for-virtual-printer