EPOS – ESC/P Printing graphics to receipt printers

Here is a way to print graphics to an EPOS receipt printer using APA(All Points Addressable) format.  When printing to one of these little receipt printers, you could always use a windows driver which lets windows see it as standard GDI printer and therefore send graphics as a bitmap to the printer from any windows program.  This works but its extremely slow.  A 24dpi printer will take a long time to print a big bitmap image.

The ultimate way to send a bitmap to the printer is by using ESC/P commands  and building vertical segment slices in code and sending these to the printer.  It’s extremely fast.  There is some work involved in understanding how this is done.  The coding is not that complicated, however, if you don’t have a grasp of how these dot matrix printers handle bitmap image slices, you will have a tough time. So lets get started by showing you how these printers deal with graphics slices.

I was working on a project which uses either a “Ithaca Series 90 plus” or a “Cognitive TPG-A760″ receipt printer to print a signature at the bottom of the receipts.  I opened both programming books and found generally the same graphics format.

Ithaca APA graphics command format:

APAGraphics

Cognitive TPG APA graphics command format:

APAGraphics_TPG_large

Well sure, that makes perfect sense.  It looks like I send [1B + 2A] to activate graphics mode then send [33] to select 24-dot double density then [n1 n2??????]. What?  Nowhere is this explained very well.  The bit layout at the bottom does a great job of explaining the layout of each slice, but what about n1..n2?  I assume that d1..d2 is the data.  so n1..n2 must be size of the data in some way.   It is quite confusing and terribly written but if you study the formula given for 8 dot mode, it starts to make, well, no sense at all.

As it turns out, the best explanation I have ever read that explains this so well, which is also the inspiration for creating this Delphi Snippet, is Nicholas Piasecki’s blog.

And here is the snippet:

 

 

Example:

 


  • Facebook
  • Add to favorites
  • Email
  • RSS
  • PDF
  • Print

2 Responses to “EPOS – ESC/P Printing graphics to receipt printers”

  1. This can also be done using the “GS v 0″ ESC/POS command which is simpler to use and the image quality looks a little better.

    • Chris McClenny says:

      Hi Les,
      Thanks for the connection on LinkedIn by the way!

      I have never used that specific command myself. I don’t even remember seeing that one in the programming manual as being supported by the TPGA760 that we were using at the time. I will definitely check it out and thanks for the tip. You are the hardware expert(per your credentials on LinkedIn). I will check this in the manual in the morning and report back.

      Thanks again.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">