Search code examples
windowsprintingvirtualdriver

I need to create a virtual printer driver for windows which will redirect requests through another program


To summarize my issue, I work at a company that uses a laser to create labels that go on our product. The laser came with a specific marking software that has an API that we use with our custom-written software to handle each request. As it works now, the marking software stays open and waits for a request from our software and will mark the label when requested to do so.

I would like to change how this all works. I'd like to make a virtual printer for the laser that will take a print request and redirect that request to the marking software included with the laser. As part of this project, I am trying to reverse engineer the file structure the marking software uses so that I can generate the labels directly, and then only use the marking software to send them to the laser. The ultimate goal would be to expand the limited use of this laser so I can handle print requests from any software. The printer driver would be used to limit the use of the marking software. It has some memory leaks and can't seem to handle large print jobs. The virtual printer would need to handle the queue of requests, sending the next job only when the previous one completed, ultimately launching the marking software to do each print job and closing it when completed.

I looked a bit at Redmon, which can allow you to redirect a request to a program, but seems to ultimately need a printer to complete its requests.

Any suggestions? Thanks in advance.


Solution

  • Redmon doesn't need a printer in the end (or shouldn't). You can simply launch a program and stop there. If you continue to run into problems we have a port monitor that is similar to redmon but simplified. It might work for you. Test more with Redmon and if you can't make it work add a comment to my answer.