I'm looking to create a virtual printer that passes data to my .NET application. I want to then create an installer that installs both the printer and the .NET application. It would we really nice to be able to write it all in C#, but I have a feeling that this will require a printer driver to be written is unmanaged code. Does anyone know of a fairly clean tutorial or example of how to do this?
I think you will have to do a lot of WinAPI wrapping. Start researching on Windows Driver Development Kit to find the things you have to do.
I also found this commercial Printer Driver Resource Toolkit for .NET...
Why not consider using an alternative approach. Like using an intermediate ready made printing program, such as those freely available Print-to-PDF application. Then all you need is to decode PDF using some 3rd party library (which has free and opensource variance too) instead of cracking your head to reinvent the wheel. There are other Print-to-XXX application which you could also consider depending on the format you see fit.
I don't thing interpreting PDF approach is any good either. I don't know why you want to do what you want to do. Maybe you're trying to write a PDF printer of your own.
I think you should really give the Windows Driver Development thing a look. If you want to develop a printer driver, I think you'll have to do it in C++.
Good Luck.
You could simply have your app expose itself like an LPD type printer or monitor port 9100. You could then install any print driver you like, and point it a your app.
Was looking for an answer for similar question, and found this link through Wikipedia - http://www.colorpilot.com/emfprinterpilot.html (allows to create Virtual Printers in different languages)
If I remember correctly Microsoft does not support .NET within printer driver development. I have yet to come across a pure .NET printer driver. You will be a very brave man to do so! The website "Printer Driver Resource Toolkit" does not say that the driver has been written in .NET
David Osborn did you find an answer to your question? If so I like to know because I'm facing the same problem.