Intercept Data Sent to Printer and Insert Into Database

  • Thread starter Thread starter Patriicia
  • Start date Start date
P

Patriicia

A legacy application (I don't have the source code for the
application) transmits reports to a printer. One of the
reports that are sent to the printer needs to be inserted
into a database. With VB.NET can I intercept items that
are sent to the printer? Can I read what is being sent to
the buffer with VB.NET and save to a file? Please let me
know if this is possible with VB.NET. Should I be using a
memorystream and window services? Please let know if you
have any ideas. I could use all the help that I can get.
Thanks
 
Patriicia said:
A legacy application (I don't have the source code for the
application) transmits reports to a printer. One of the
reports that are sent to the printer needs to be inserted
into a database. With VB.NET can I intercept items that
are sent to the printer? Can I read what is being sent to
the buffer with VB.NET and save to a file? Please let me
know if this is possible with VB.NET. Should I be using a
memorystream and window services? Please let know if you
have any ideas. I could use all the help that I can get.

The only *easy* way to do this would be to setup an IP port, then tell the
legacy app to print to that port. Next, you would need to setup a server in
VB to listen on that port, and then pass the data onto the final
destination. So you would be making a mini proxy server, just remember to
pass back any info that may come from the printer.

A better way would be to create a custom port, or to subclass the print
spooler/print messages, but this is beyond me, sorry. I'm sure if you dig
around in the Platform SDK / MSDN library long enough you will find what you
need.

HTH
~
Jeremy
 
Back
Top