Click here to Skip to main content
14,930,079 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to ask if it is possible to intercept the document data that is sent to the printer. I want to save the data into a text file without interrupting the print queue.

What I have tried:

Is it possible to do it with a VB .NET script?
Posted
Updated 3-May-21 21:23pm
v2

It's possible, yes - but it's going to be really, really difficult.
You'll need to start here: RedMon - Redirection Port Monitor[^] (or find something similar) and then "decode" the printer output (as it isn't sent to the printer in the form of text) back into "English" you can save. Bear in mind that the output will be different for each printer type it's going to, and probably each version of the printer driver as well - so you may have to do a heck of a lot of different "decode" methods.

It's a lot of work - much, much easier to modify your application to save it when it prints (and less likely to destabilize your computer, as well).
   
Comments
CPallini 4-May-21 2:32am
   
5.
nkm00e 4-May-21 2:40am
   
Thank you for the answer. I have another question, what exactly am I supposed to save in the application? Is it the whole document that is supposed to be printed?
OriginalGriff 4-May-21 2:50am
   
How do you expect me to have any idea what your application is supposed to do, or save? :laugh:

Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with. I've never seen your app, heard of your app, or have any idea what on earth it is supposed to do in the first place!
nkm00e 4-May-21 2:59am
   
Oh apologies for that. I want to save the document data into a text file when the document is sent to the driver for printing.
OriginalGriff 4-May-21 3:17am
   
So ... are you waiting for permission? Is so, consider it given ...
nkm00e 4-May-21 3:22am
   
Thank you for the help
OriginalGriff 4-May-21 3:40am
   
You're welcome!
I gave you the answer yesterday at Is it possible to intercept data sent to a printer via usb cable?[^]. Reposting the question will not change the answer. And, no, it is not possible to do it with VB.
   
v2
Comments
nkm00e 4-May-21 3:52am
   
Thank you for your help

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900