ESC/POS Printers

Hello everyone,

After a small forum search, I believe I'm not duplicating any topic, so before we start experimenting, anyone has any tips to work with EPSON ESC/POS Printers (EPSON TM, for example).

Any pre-condition we should consider, or any suggested approach for us to start from?

PS - i was considering designing in runtime with ESC, but it is possible to create a parameterized report if that is the best approach.

Thank you all in advance,

Bruno Nunes

I've used a similar setup with a Zebra printer (ZPL for their language).

You could create a DB or just constants in a script that holds a lot of the ASCII for the printer language. You can then insert your parameters into that string and send your ESC string over TCP to the printer with sockets. Hardest part of the whole process is just creating the initial label.

I've also added the printer as a device and used tags to send the strings to the printer. Both worked fine.

Currently I've bypassed the printer languages all together and went with BarTender software to manage my labels and printers. Cost wise, the subscription model of BarTender might be more, but now anyone can very and modify the labels through a designer rather than looking at confusing strings. The time savings tips the scale in my opinion.


Hi Kyler

"I've also added the printer as a device and used tags to send the strings to the printer. Both worked fine."

I'm also using an EPSON printer, I'm having difficulties printing by writing the string to the tags, can you please share the string that you sent to the tags.

When I send the strings to the tags they print as they are, with the ESC commands also printing as part of the text.


You will want to make sure you are sending the string as raw hex or binary data (ascii).

'ESC' isn't really 3 letters, it's a command that won't show up normally in a text box or editor. Use something like Notepad++ and set up the view to show raw values.

ESC = 27 or 0x1B

Look up an ascii table then research how to convert a string to ascii in python. Jython has some character combos that represent commands like ESC.