Need help creating a printer driver

I need help creating a printer driver. The printer connects to the system through a serial port. I just need to grab the data the application is sending to the printer, compress it (its a custom procedure), and send it to the printer.

I have no experience in driver development. I have all the tools, SDK, DDK. If anyone can provide any link to a sample driver (which can just write to a flat file instead of sending it to the printer) that would be great.

The driver must run on Windows NT.

So basically, I'm looking for an example printer driver, the DDK (named winprint) has one, but when I compile and link it, it generates a dll file instead of sys.

Don't repeat again that the WDK will not work as this driver will work on NT.

+2


a source to share


2 answers


You must use Win NT DDK. He will have sample files. Also on Windows NT, printer driver files are .dll files, not .sys files. Printer drivers are another category of drivers in Win NT and must be installed using the Add Printer Wizard and in the form of a package with an INF file.

If you already have Win NT DDK, you can use the sample TTY driver that is provided. I believe this is available at% DDKROOT% \ Src \ Print \ Mini \ Txtonly.

This article explains some of the updates to this driver - http://support.microsoft.com/kb/289108



Once you can install and run this driver, you should be able to see the main code and add your own code to receive the input and pass it to a file.

Hope this helps. If yes, then +1 :)

0


a source


You don't need to modify your code to get a driver that can write to a flat file.



The Windows printer driver can be connected to various ports. In particular, you can create a local port that is actually connected to the file. On the "Printer Ports" tab, click [Add Port], and then select "Local Port" and click [New Port]. In the Enter port name control to edit text, enter the path to the file you want to populate with PDL data. Then, each time you print afterwards, the PDL from the driver is written to the file associated with the new port, overwriting its previous contents.

0


a source







All Articles