Send Command to Printer Functionality
The “Send Command to Printer” feature allows you to send various commands to a thermal printer, enabling you to execute multi-print-oriented commands. This feature supports three command formats: decimal, ASCII, and hexadecimal. When using decimal or hexadecimal values, make sure to separate them with commas.
If you want to send your own build command to printer, This the way to send and we are with you to help such feature.
How to Use “Send Command to Printer”:
- Select Command Format: Choose the appropriate command format from the provided options: decimal, ASCII, or hexadecimal.
- Enter Commands: Enter the commands you wish to send in the selected format. For decimal and hexadecimal, use commas to separate values.
- Click execute button and see the output on printer. Please make sure that you have connected with printer.
Command Formats:
- Hexadecimal: This format lets you send commands as a series of hexadecimal values, separated by commas.
- Decimal: This format allows you to send commands as a list of decimal values, separated by commas.
- ASCII: You can send commands as plain text in ASCII format.
Command Explanation | HexaDecimal Value | Decimal (byte) | ASCII | Options |
Initialize printer | 1B,40 | 27,64 | ESC @ | |
Line Feed | A | 10 | \n | |
Bold Text | 1B,21, n Where ‘n’ – 0 – normal1 – small bold8 – normal bold10 – double height bold20 – double width bold30 – double height, width bold | 27,33,n Where ‘n’0 – normal1 – small bold 8 -normal bold16 -double height bold32 -double width bold48 – double height, width bold | ESC ! n | |
Bold with large text | 1B,69,1 | 27,69,1 | ESC E 1 | |
Under line with normal text | 1B,21,80 | 27,33,128 | ESC ! ] | |
Underline with large text | 1B,2D,1 | 27,45,1 | ESC – 1 | |
Left alignment(default) | 1B,61,1 | 27,97,0 | ESC a 0 | This command is only valid at the beginning of the line. |
Right alignment | 1B,61,2 | 27,97,2 | ESC a 2 | This command is only valid at the beginning of the line. |
Center alignment | 1B,61,1 | 27,97,1 | ESC a 1 | This command is only valid at the beginning of the line. |
Reverse the text | 1D,42, n | 29,66, n | GS B n | 0 for off, 1 for on |
Set left margin | 1D,4C, nL, nH | 29,76, nL, nH | GS L nL nH | where ‘nL’ and ‘nH’ specify the margin position |
Set right margin | 1D,52, nL, nH | 29,82, nL, nH | GS R nL nH | where ‘nL’ and ‘nH’ specify the margin position |
Set line Spacing | 1B,33, n | 27,51, n | ESC 3 n | where ‘n’ is the number of 1/8-inch line spacing |
Bar code | 1D,6B,m,n | 29,107,m,n | GS k m n | 0 <= m => 6n => code value |
Upside Down | 1B,7B,n | 27,123,n | ESC { n | n => 1 for uside down is enabled, n => 0 is for disabled.Eg: 27,123,1 |
Sample Command
- Height increased text.
Command with hexadecimal value.
1d,21,00,31,1d,21,11,32,1d,21,22,33,1d,21,33,34,1d,21,44,35,1d,21,55,36,1d,21,66,37,1d,21,77,38,0a
Result:
Command explanation:
1d,21,00 | Command for normal text (single height) |
31 | hexadecimal value for “1” |
1d,21,11 | increasing the text height |
32 | hexadecimal value for “2” |
1d,21,22 | increasing the text height |
33 | hexadecimal value for “3” |
1d,21,33 | increasing the text height |
34 | hexadecimal value for “4” |
1d,21,44 | increasing the text height |
35 | hexadecimal value for “5” |
1d,21,55 | increasing the text height |
36 | hexadecimal value for “6” |
1d,21,66 | increasing the text height |
37 | hexadecimal value for “7” |
1d,21,77 | increasing the text height |
38 | hexadecimal value for “8” |
0a | ending the current line or new line command |
- Max width text :
1b,21,00,1d,21,30,48,65,6c,6c,6f,20,77,6f,72,6c,64,21,0a,1d,56,41,03
Command Explanation:
1b,21,30 | Command for max width text |
30,48,65,6c,6c,6f,20,77,6f,72,6c,64,21,0a,1d,56,41,03 | Hello world! |
Please note that the exact commands and their format can vary depending on your thermal printer’s model and the commands it supports. It’s essential to consult your printer’s documentation or the manufacturer for a comprehensive list of commands and their descriptions specific to your printer model.
These are just a few common ESC commands used in thermal printing. To use these commands effectively, you should consult your thermal printer’s documentation for a complete list of supported commands and their specific parameters. This information will help you tailor the commands to your printer’s capabilities and requirements.
Please remember that the actual commands and their parameters may vary depending on your specific thermal printer model. Refer to your printer’s documentation for a complete list of supported commands and their specific values to ensure correct and effective usage.
Few Reference Command list documents:
- Reference obsolute Command for EPSON link – https://download4.epson.biz/sec_pubs/pos/reference_en/escpos/ref_escpos_en/obsolete.html
2. BS32 list
3. Image print content – https://www.visuality.pl/posts/thermal-printer-protocols-for-image-and-text
4. Thermal printer Command list
5.