3

I have been tasked with writing a print driver. I have no experience with this and have been researching it for a few days. The goal of this is to essentially write the data coming to the driver to a file and then do some additional processing of it.

If I understand it correctly, I can start other processes to do most of the work, but I'll need the driver itself to generate the initial file/data. I am confused about what state the data is in when it comes to the driver from an application. Is this something that is determined by the application, or is there a standard of some kind?

2 Answers2

3

Go to the Windows DDK website and start from their print and imaging examples. What the driver actually does inside itself is entirely up to you, but the framework for a driver is clearly defined. The text-only driver should get you going.

Spend some time reading those examples and surrounding documentation before going off and inventing your own wheels - there's nothing worse than a shitty printer driver implementation, we have plenty of those already. Write one that integrates like its supposed to.

gbjbaanb
  • 48,749
  • 7
  • 106
  • 173
3

It is quite a while since I developed a printer driver for a customer but I will try to give you an idea of what happens. When your application communicates with an output device such as a printer or the display it opens a DC and starts sending GDI commands to draw an image on the page. The image can contain anything from picture drawing or text. The. Driver collects all this and when your are done with the page it starts transmitting the generated image using the printer language, postscript pcl or anything else to the device. This is the general idea behind these devices and the way they communicate with windows.

Gus
  • 368