0
votes

The problem

I have a Windows XP pc connected to a printer. This pc runs a piece of software from where i create and send print jobs to the printer. Recently, the printer died and there is no way i can get a new one. The program is configured to print to this specific printer, which is now a problem.

The question

Is there a way to catch the data send to windows print spooler? From what i've found, i have to develop a print monitor (.dll file which will be read by spooler.exe, correct me if i'm wrong), however this seems pretty overcomplicated for such a matter. I've been searching the Print Spooler API, but the GetJob method returns, from what i can see, only informations about the print job, and not the actual data of the print.

I would like to catch this data and then process it in a another program that I will make myself. This is not really the issue, I am more concerned to know if it is possible to catch the data from the print spooler, and if possible some hints to how i could do it.

Thank you.

1
Why not configure the computer to print to PDF?Ferenc Deak
If you don't have a working printer, why do you want to 'catch' the data?OMGtechy
@fritzone Printing to PDF is not possible. It is a very closed system unfortunately.Attaque
I think that if they let you install a custom dll they also will let you install Bullzip PDF printer ...Ferenc Deak
@OMGtechy I do have a working printer, i forgot to mention this.Attaque

1 Answers

3
votes

Your problem is more serious than you might realise. The task of transmitting spooled printer data to a specific printer is calls a Print Processor, which sits in the printer chain preceding the Print Monitor. Documentation here: http://msdn.microsoft.com/en-us/library/windows/hardware/ff551771%28v=vs.85%29.aspx

The spooled data can be in one of several different formats, and for some of them it may not be possible to redirect to a printer of a different type. You didn't mention what types of printers you are dealing with.

This is fairly serious stuff: writing and debugging one of these babies takes significant low level skills and understanding of Windows tech.

Edit: There's a good chance the data is in Enhanced Metafile format, and you need to take advantage of the built-in converters to turn that into commands for your new printer.