I'm trying to get a Spooled Document sitting in the print queue as paused to convert to a text or XML file.
I have a program written in VB.NET which monitors a particular print queue. When items are printed to this print queue it imediatly pauses the print queue and asks the person if they wish to archive the document to a text file. If they push NO then it unpauses the print queue and prints the document as normal. If they push yes I want to be able to read the body text of the document which was printed and save it it to a text file. I don't care about formating or graphics but I want to make sure I can save any text which was in this document. Once the document is saved then it unpauses the print queue and continues printing.
Most of the time this is a cash register invoice I am saving so there is things like price and items listed on the receipt which I want to archive to a text file.
I can not seem to figure out how to "read" the body of a document which is in the print que while it's paused.
One person came up with the idea of printing to a different driver which could save as a text and print to a different printer. I do not want to create another printer to print to because the end user must print to their normal printer in the app, unforantly it's hard coded where they are always printing to the same printer and there is no way to change it to print to a different printer because of this I needed to take the approach of monitoring the exsisting queue so the user does not have to change their default printer they print to.
Basically if you pause your printer, then print a word document you will have that job sitting in your print que. I want to be able to read the text of the word document that was printed and sititing in the queue. That would be an easy way to recreate what I'm trying to acomplish. Does this make sense?
I spent several days trying to figure this out and I'm lost, does anyone out there know what I can acomplish my goal?
Ideally it would need to be in VB.NET, if I really have to I can do C# but my app is
written in VB.NET so that would be ideal.
Thank You
Start Free Trial