The ESC/POS is a set of instructions for thermal paper printers communicated over serial, parallel, or USB.
Instructions[edit | edit source]
See the command reference list below for a detailed list of instructions.
Epson's command list shows the command with ASCII names rather than the hex values, so sending
1B 40 to initialize a printer is equivalent to
Here are some common instructions:
1B 40Initialize the ESC/POS printer
1C 70 01 00= Print first bit image stored in NVRam
1B 64 05 1D 56 01= Epson cutter command
0A= Line feed
Sending Bit Image[edit | edit source]
To store a bit image to NVRam, use the
1C 71 01 command, followed by 5 arguments:
- xl - image width in bytes (ie. Ceiling of Image Width in Pixels / 8). Must be between 0 - 255
- xh - image width as multiples of 256. Must be between 0 - 3.
- yl - image height in bytes (ie. Ceiling of Image Height in Pixels / 8). Must be between 0 - 255
- yh - image height in multiples of 256. Must be between 0 - 1.
- bit image data. Length must be (xl + yl + ((xh + yh) * 256)) * 8.
The image bitmap data is sent to the printer ordered from top to bottom, left to right. 8 pixels per byte.
For example, sending a 4x4 black bitmap image would result in 8 bytes of data:
1111 0000- 1st column, 4 black, plus 4 blank pixels
1111 0000- 2nd column
1111 0000- 3rd column
1111 0400- 4th column. Last byte at the end of the image ends with 04. see below.
0000 0000- 5th column, outside of the original 4x4 image
0000 0000- 6th column
It also seems like the end of the image is terminated with a
04 code... but i'm not sure if this is true as it isn't documented. It is sent by the logo utility though.
See Also[edit | edit source]
Epson's 'official' documents:
Epson's Logo Utility: