Simple commands for handling esc-pos statements
<EscPos>
<Init/>
<QrCode>QR Test Text</QrCode>
<Feed lines="1"/>
<BarCode>1234567890</BarCode>
<Feed lines="1"/>
<PDF417>PDF417</PDF417>
<Feed lines="1"/>
<Text fontWidth="3" fontHeight="3">Large Text</Text>
<Text fontWidth="2" fontHeight="2">Medium Text</Text>
<Text fontWidth="1" fontHeight="1">Small Text</Text>
<Feed lines="1"/>
<Text justification="left">Left</Text>
<Text justification="center">Center</Text>
<Text justification="right">Right</Text>
<Feed lines="1"/>
<Text underline="one-dot-thick">Underline</Text>
<Text bold="true">Bold</Text>
<Text inverse="true">Invested</Text>
<Feed lines="1"/>
<Text fontWidth="2" fontHeight="2" justification="left" bold="true" underline="one-dot-thick">
Large Text/Bold/Underline
</Text>
<Feed lines="3" />
<Cut mode="full" />
</EscPos>
Initialize printer. Clears the data in the print buffer and resets the printer.
<Init/>
| Parameter | Value | Description |
|---|---|---|
| width | number |
Ticket width in millimeters |
| marginLeft | number |
Left margin in millimeters |
| dpi | "203", "300", "600" |
DPI to calculate the width and margin of the ticket |
<EscPos>
<Init/>
</EscPos>
This command is used to print text.
<Text>Content</Text>
| Parameter | Value | Description |
|---|---|---|
| font | "A", "B", "C" |
font name |
| fontWidth | [1-8] |
char width |
| fontHeight | [1-8] |
char height |
| justification | "left", "center" or "right" |
Set horizontal justification |
| underline | "one-dot-thick", "two-dot-thick", "none" |
Underline |
| lineSpacing | [0-255] |
Set line spacing |
| doubleStrike | true or false |
Double Strike |
| bold | true or false |
Bold |
| inverse | true or false |
Reversed |
| lf | true or false |
Activate or deactivate the line break at the end of the text |
<EscPos>
<Text
font="A"
fontWidth="1"
fontHeight="1"
justification="left"
underline="none"
lineSpacing="0"
doubleStrike="true"
bold="true"
inverse="true"
lf="true"
>
Hola Mundo
</Text>
</EscPos>
This command prints a QR code.
<QrCode>Content</QrCode>
| Attributes | Value | Description |
|---|---|---|
| model | "1" or "2" |
QRCode model |
| errorCorrectionLevel | "L", "Q", "H" or "M" |
QR Error Correction Level |
| size | [1-16] |
Set the size of module in dots |
| justification | "left", "center" or "right" |
Set horizontal justification |
<EscPos>
<QrCode
model="1"
errorCorrectionLevel="M"
size="3"
justification="left"
>
1234567890
</QrCode>
</EscPos>
This command prints a Barcode code.
<BarCode>Content</BarCode>
| Parameter | Value | Description |
|---|---|---|
| type | "upca", "upca_b", "upce_a", "upce_b", "jan13_a", "jan13_b", "jan8_a", "jan8_b", "code39_a", "code39_b", "itf_a", "itf_b", "codabar_a", "codabar_b", "code93_default", "code128" | Provide bar-code system |
| width | [2-6] |
Code width |
| height | [1-255] |
Code height |
| hriPosition | "above-bar-code", "below-bar-code", "above-and-below-bar-code", "not-printed" |
Human Readable Interpretation (HRI) position |
| hriFont | "A", "B", "C" |
Human Readable Interpretation (HRI) font |
| justification | "left", "center" or "right" |
Set horizontal justification |
<EscPos>
<BarCode
type="code128"
width="2"
height="40"
hriPosition="below-bar-code"
hriFont="A"
justification="left"
>
1234567890
</BarCode>
</EscPos>
This command is used to print a PDF code.
<PDF417>Content</PDF417>
| Parameter | Value | Description |
|---|---|---|
| option | "truncated", "standard" |
PDF417 Option |
| errorCorrectionLevel | [0-8] |
PDF417 Correction Level |
| width | [3-5] |
Code width |
| height | [2-8] |
Code height |
| numberOfColumns | number | Set the number of columns in the data region |
| numberOfRows | number | Set the number of rows |
| justification | "left", "center" or "right" |
Set horizontal justification |
<EscPos>
<PDF417
option="standard"
errorCorrectionLevel="1"
width="3"
height="4"
numberOfColumns="0"
numberOfRows="0"
justification="left"
>
1234567890
</PDF417>
</EscPos>
This command prints a QR code.
<Image/>
| Attributes | Value | Description |
|---|---|---|
| uri | "http", "https", "file" |
Identificador Uniforme de Recursos |
| base64 | "string" |
Image content in base64 format |
| width | number |
Image width |
| height | number |
Image height |
| justification | "left", "center" or "right" |
Set horizontal justification |
| filter | "dither" or "monochrome" default:"dither" |
Filter for the image |
| threshold | [0-255] default:127 |
Threshold for gray scale |
<EscPos>
<Image
uri="https://labeldictate.com/text2barcode/docs/static/img/t2b.png"
width="500"
/>
</EscPos>
Prints the data in the print buffer and feeds n lines.
<Feed/>
| Parameter | Value | Description |
|---|---|---|
| lines | number |
number of lines |
<EscPos>
<Feed lines="1" />
</EscPos>
This command is used to set the cut to the printer.
<Cut/>
| Parameter | Value | Description |
|---|---|---|
| mode | "part", "full" |
paper cutting |
<EscPos>
<Cut mode="full" />
</EscPos>
Selecciona la tabla de caracteres (code page) de la impresora.
<CharacterCodeTable value="ENUM_NAME"/>
| Value | Description |
|---|---|
| CP437_USA_Standard_Europe | USA / Standard Europe (Code Page 437) |
| Katakana | Katakana (Japanese) |
| CP850_Multilingual | Multilingual Latin-1 (Code Page 850) |
| CP860_Portuguese | Portuguese (Code Page 860) |
| CP863_Canadian_French | Canadian French (Code Page 863) |
| CP865_Nordic | Nordic (Code Page 865) |
| CP851_Greek | Greek (Code Page 851) |
| CP853_Turkish | Turkish (Code Page 853) |
| CP857_Turkish | Turkish (Code Page 857) |
| CP737_Greek | Greek (Code Page 737) |
| ISO8859_7_Greek | ISO-8859-7 Greek |
| WPC1252 | Windows Latin-1 (Western Europe, CP1252) |
| CP866_Cyrillic_2 | Cyrillic #2 (Code Page 866) |
| CP852_Latin2 | Latin-2 (Central Europe, CP852) |
| CP858_Euro | Multilingual + Euro symbol (CP858) |
| KU42_Thai | Thai (KU42) |
| TIS11_Thai | Thai (TIS11) |
| TIS18_Thai | Thai (TIS18) |
| TCVN_3_1_Vietnamese | Vietnamese (TCVN 3.1) |
| TCVN_3_2_Vietnamese | Vietnamese (TCVN 3.2) |
| PC720_Arabic | Arabic (PC720) |
| WPC775_BalticRim | Baltic Rim (Windows CP775) |
| CP855_Cyrillic | Cyrillic (Code Page 855) |
| CP861_Icelandic | Icelandic (Code Page 861) |
| CP862_Hebrew | Hebrew (Code Page 862) |
| CP864_Arabic | Arabic (Code Page 864) |
| CP869_Greek | Greek (Code Page 869) |
| ISO8859_2_Latin2 | ISO-8859-2 Latin-2 |
| ISO8859_15_Latin9 | ISO-8859-15 Latin-9 (Euro update) |
| CP1098_Farsi | Farsi / Persian (Code Page 1098) |
| CP1118_Lithuanian | Lithuanian (Code Page 1118) |
| CP1119_Lithuanian | Lithuanian (Code Page 1119) |
| CP1125_Ukrainian | Ukrainian (Code Page 1125) |
| WCP1250_Latin2 | Windows Latin-2 (CP1250) |
| WCP1251_Cyrillic | Windows Cyrillic (CP1251) |
| WCP1253_Greek | Windows Greek (CP1253) |
| WCP1254_Turkish | Windows Turkish (CP1254) |
| WCP1255_Hebrew | Windows Hebrew (CP1255) |
| WCP1256_Arabic | Windows Arabic (CP1256) |
| WCP1257_BalticRim | Windows Baltic (CP1257) |
| WCP1258_Vietnamese | Windows Vietnamese (CP1258) |
| KZ_1048_Kazakhstan | Kazakhstan (KZ-1048) |
| User_defined_page | User defined character page |
WPC1252.
En hardware que requiera “€” con PC858, usa CP858_Euro.
<EscPos>
<Init/>
<CharacterCodeTable value="WPC1252"/>
<Text>á é í ó ú ñ Ñ €</Text>
<Feed lines="1"/>
<Cut mode="part" />
</EscPos>
Configura el modo de extensión del juego de caracteres mediante el comando
FS 2E n internamente. Este nodo solo acepta nombres de enum
definidos en EscPos.CharacterSetExtensionMode.
<CharacterSetExtensionMode value="ENUM_NAME"/>
| Value | Description |
|---|---|
| NORMAL | Modo estándar sin extensión especial. |
| COMPATIBLE | Modo de compatibilidad con juegos de caracteres ampliados. |
| Modo especial utilizado en firmware chino (impresoras WeChat). |
<EscPos>
<Init/>
<CharacterCodeTable value="WPC1252"/>
<CharacterSetExtensionMode value="NORMAL"/>
<Text>á é í ó ú ñ Ñ €</Text>
<Feed lines="1"/>
<Cut mode="full" />
</EscPos>
command to write bytes, each byte must be separated by a comma.
String with hexadecimal pairs separated by spaces
<EscPos>
<!-- Initialize printer - ESC @ -->
<Bytes>1B 40</Bytes> <!-- Hex -->
<!-- Print "Hello World" - Text data -->
<Bytes>48 65 6C 6C 6F 20 57 6F 72 6C 64</Bytes> <!-- Hex for "Hello World" -->
<!-- Two Line Feeds - LF -->
<Bytes>0A 0A</Bytes> <!-- Hex for two line feeds -->
<!-- Cut Paper - GS V 49 -->
<Bytes>1D 56 31</Bytes> <!-- Hex -->
</EscPos>
ESC/POS Documentation