[WinPrnDev] Re: Intercepting data sent to the printer

  • From: "Christoph Lindemann" <Christoph.Lindemann@xxxxxxxxxxxxxxxxxxx>
  • To: <winprndev@xxxxxxxxxxxxx>
  • Date: Tue, 29 Nov 2011 10:10:29 +0100

Hi Akshay,

 

The data stream is probably encoded as Esc/POS, a variation of Esc/P or
Esc/P2.

http://www.undocprint.org/formats/page_description_languages/esc_p2

 

You can try the following tool

QPCPrint http://www.kilgus.net/qpcprint/index.html

QPCPrint is an emulator that accepts input in ESC/P2 format, be it text
or raster graphics, and outputs the result to any Windows compatible
printer. The emulation has a precision of 1440dpi and matches the output
of a real printer extremely well.

 

If the third party application prints directly to the printer, without
using the Windows printer driver, then you can do your own application,
which modifies the Esc/P data. You can get reference manuals at the
Epson Developer website.

 

If the third party application uses GDI and the Windows printer driver
(You could check that by testing if the application can print to any
printer installed in windows. For example a HP LaserJet.). Then you
could build your own virtual EMF printer driver, or license one of the
many available EMF printer driver SDK's:

http://www.colorpilot.com/emfprinterpilot.html

http://www.verypdf.com/artprint/mini-emf-printer-driver.htm

http://www.blackice.com/Printer%20Drivers/EMF%20Printer%20Drivers.htm

 

 

Best regards,

Christoph

 

 

________________________________

From: winprndev-bounce@xxxxxxxxxxxxx
[mailto:winprndev-bounce@xxxxxxxxxxxxx] On Behalf Of akshay gupta
Sent: Tuesday, November 29, 2011 9:30 AM
To: winprndev@xxxxxxxxxxxxx
Subject: [WinPrnDev] Re: Intercepting data sent to the printer

 

Thanks for quick replies, Ill tell exactly what i want and what i have
tried till now.

What I want : 
There is a third party application whose task is to generate a document
(which is sort of a bill) and after generating it, it prints that
document. Now I want to some how get the text that printer will
printing  before it actually prints it, and modify it and send the
modified text back to the printer.

What I have tried: 
I have Experimented with  EPSON TM-T88IV Receipt printers.
1) I first though that I would print to a file and then read and edit
the contents of that file and send it to the printer for printing. But
the file that it created didnt contained what I expected. It had
unreadable data which I had no idea how to convert it to a readable
format.

2)I tried hooking to the com port and intercept the data that is flowing
through it. But again all I got was a stream of unreadable data.

Regards,
Akshay 



On Tue, Nov 29, 2011 at 1:25 PM, Christoph Lindemann
<Christoph.Lindemann@xxxxxxxxxxxxxxxxxxx> wrote:

Hi Akshay,

 

Check out the Windows Driver Development Kit (WDK) documentation about
how the print spooler is working.

 

The available options depend on how the application is sending data to
the printer, and what you are trying to accomplish. Is the application
using the GDI API to render the job, or is it sending the data directly
to the printer? Do you want to capture the print like a virtual printer?
Or do you just want to "listen" to the job data, but the data should
still go to the printer? Do you want to modify the data stream? What
type is the printer?

 

I think it would be best, if you give us more context information,
describe what you want to accomplish? Why? And what your own ideas are,
on how to do this.

 

Best regards

Christoph

 

________________________________

From: winprndev-bounce@xxxxxxxxxxxxx
[mailto:winprndev-bounce@xxxxxxxxxxxxx] On Behalf Of akshay gupta
Sent: Tuesday, November 29, 2011 8:32 AM
To: winprndev@xxxxxxxxxxxxx


Subject: [WinPrnDev] Intercepting data sent to the printer

 

Hi,



I am working with an application that prints to a thermal POS printers
in windows environment.
Can somebody please tell me how can I get the actual text(readable)
after a print command is fired from that application. I have no control
over the code of that application therefore I want to do it at the
spooler level or at the driver level , or some how interpret  the data
flowing through the COM port.

Regards,
akshay

 

Other related posts: