Charset encoding To change charset encoding of the printer, use EscPosCharsetEncoding class :

EscPosPrinter printer = new EscPosPrinter(deviceConnection, 203, 48f, 32, new EscPosCharsetEncoding("windows-1252", 16)); escPosCharsetId may change with printer model. Follow this link to find escPosCharsetId that works with many printers

Formatted text : syntax guide New line Use \n to create a new line of text.

Text alignment and column separation Add an alignment tag on a same line of text implicitly create a new column.

Column alignment tags :

[L] : left side alignment [C] : center alignment [R] : right side alignment Example :

[L]Some text : One column aligned to left [C]Some text : One column aligned to center [R]Some text : One column aligned to right [L]Some text[L]Some other text : Two columns aligned to left. Some other text starts in the center of the paper. [L]Some text[R]Some other text : Two columns, first aligned to left, second aligned to right. Some other text is printed at the right of paper. [L]Some[R]text[R]here : Three columns. [L][R]text[R]here : Three columns. The first is empty but it takes a third of the available space. Font Size tag allows you to change the font size and color. Default size is normal / black.

Some text : Normal size

Some text : Double width of medium size

Some text : Double height of medium size

Some text : Double width and height of medium size

Some text : black text - white background

Some text : white text - black background

Some text : red text - white background (Not working on all printer)

Some text : white text - red background (Not working on all printer)

Bold tag allows you to change the font weight.

Some text Underline tag allows you to underline the text.

Some text text underlined Some text text double-strike (Not working on all printer) Image tag allows you to print image. Inside the tag you need to write a hexadecimal string of an image.

Use PrinterTextParserImg.bitmapToHexadecimalString to convert Drawable, BitmapDrawable or Bitmap to hexadecimal string.

hexadecimal string of an image ⚠ WARNING ⚠ : This tag has several constraints :

A line that contains can have only one alignment tag and it must be at the beginning of the line. must be directly preceded by nothing or an alignment tag ([L][C][R]). must be directly followed by a new line \n. You can't write text on a line that contains . Barcode tag allows you to print a barcode. Inside the tag you need to write the code number to print.

451278452159 : (12 numbers) Prints a EAN13 barcode (height: 10mm, width: ~70% printer width, text: displayed below). 4512784 : (7 numbers) Prints a EAN8 barcode (height: 10mm, width: ~70% printer width, text: displayed below). 4512784521 : (11 numbers) Prints a UPC-A barcode (height: 20mm, width: ~70% printer width, text: displayed below). 512789 : (6 numbers) Prints a UPC-E barcode (height: 25mm, width: ~50mm, text: hidden). DantSu : (string) Prints a barcode 128 (height: 10mm, width: ~40mm, text: displayed above). ⚠ WARNING ⚠ : This tag has several constraints :

A line that contains can have only one alignment tag and it must be at the beginning of the line. must be directly preceded by nothing or an alignment tag ([L][C][R]). must be directly followed by a new line \n. You can't write text on a line that contains . QR Code tag allows you to print a QR code. Inside the tag you need to write the QR code data.

http://www.developpeur-web.dantsu.com/ : Prints a QR code with a width and height of 20 millimeters. 123456789 : Prints a QR code with a width and height of 25 millimeters. ⚠ WARNING ⚠ : This tag has several constraints :

A line that contains can have only one alignment tag and it must be at the beginning of the line. must be directly preceded by nothing or an alignment tag ([L][C][R]). must be directly followed by a new line \n. You can't write text on a line that contains .