Writing a Windows printer driver

I have just started a new programming project which involves writing a Windows printer driver for creating PDF files. This is a new type of project for me so my first thought was to search Google for information and resources on using the Windows DDK. Usually you can find lots of resources about just about any programming subject through Google but I found very little about the DDK and even less regarding printer drivers. After finding so little information online I thought it would be useful to blog about my experiences, hopefully making life a little easier for anyone else working on a similar project.

There are two reasons I started this project which will become a standard module of the main product of my software Print Distributor. The first is I have been finding a substantial number of my customers are using my software to create PDF files in conjunction with Adobe Acrobat Distiller. Making this work is far from trivial, it involves configuring my software to print to file using a PostScript driver then setting up Distiller with watched folders to convert that file to a PDF or calling Distiller with some command line options. Wanting to avoid customers having to configure options like the dialog above I decided it would be much better if the PDF creation was handled right in my software taking away the need to install Acrobat at all.

The second problem I have is customers who need to modify their output after they have printed. There are lots of reasons they might want to do this from selecting different paper trays for copies through to water-marking the final print. At the moment Print Distributor doesn’t have an option for this because we pick up the print job after it has been rendered by the printer driver, this means we can’t really modify the file because we can’t hope to understand every different format of prn file being used. By using a restricted set of PDF functions it should be reasonably easy to use PDF as an interim format as jobs pass through Print Distributor.