Page 1 of 1

Printing an image via printUnformatted

Posted: Sun Sep 11, 2011 11:47 am
by Mrpopup
We have a need to print an image (logo) on a serial thermal printer. All output to this device is via printUnformatted.
Does anyone know how to achieve this?
Printer is an Epson TM-T88iii.
Thanks.

Re: Printing an image via printUnformatted

Posted: Sun Sep 11, 2011 7:51 pm
by murray
We have a need to print an image (logo) on a serial thermal printer. All output to this device is via printUnformatted.
Does anyone know how to achieve this?
Printer is an Epson TM-T88iii.
Thanks.
The Epson printers have a command set for performing a wide range of functions, including printing a bitmap image. Typically they start with the ASCII "Escape" character followed by a few characters of parameters, followed by a block of binary data representing the bitmapped image.
e.g. ESC, '*', m, nL, nH, d1, d2, ... dn (where m sets the graphics mode and nL and nH set the number of data bytes).
In this example d1, d2 ... dn represent the bitmap data bytes which need to be readfrom a bitmap image file. Some data conversion may be necessary to get the bitmap into the desired format for printing.

If you don't already have the command reference manual you should be able to locate a copy on the web.
The older Epson printers always used to have a debug feature where you could switch them into a mode that would dump out all the received data in a hexadecimal dump to verify what bytes the printer was actually receiving. I presume the current models still include such a feature - I used to find it useful for debugging the command sequences.