General Printer Commands
Command Lists:
Command | Code Description | Function Description | |||||||
|
|
| (Hex) |
|
|
|
| ||
HT | 09 |
|
|
|
|
|
|
| Horizontal tab |
|
|
|
|
|
|
|
|
|
|
LF | 0A |
|
|
|
|
|
|
| Print and line feed |
|
|
|
|
|
|
|
|
|
|
CR | 0D |
|
|
|
|
|
|
| Print and carriage return |
|
|
|
|
|
|
|
| ||
ESC SP n | 1B | 20 n | 0 | n |
| 255 | Set | ||
|
|
|
|
|
|
|
| ||
ESC ! n | 1B | 21 n | 0 | n |
| 255 | Select print mode(s) | ||
|
|
|
|
|
|
|
| ||
ESC $ nL nH | 1B | 24 nL nH |
|
|
|
| Set absolute print position | ||
| 0 | nL |
| 255 |
|
|
|
|
|
| 0 | nH |
| 255 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ESC % n | 1B | 25 n |
|
|
|
|
| Select/cancel | |
| 0 | n | 255 |
|
|
|
| character set | |
|
|
|
|
|
|
| |||
ESC & y c1 c2 | 1B | 26 y c1 c2 |
|
|
| Define | |||
| y=3 32 | c1 |
| c2 | 126 |
| |||
|
|
|
|
| |||||
ESC * m nL nH d1 dk | 1B | 2A m nL nH d1 | dk | Select | |||||
| m=0,1,32,33 | 0 | nL 255 |
| |||||
| 0 | nH |
| 3 0 |
| d |
| 255 |
|
|
|
|
|
|
|
|
|
| |
ESC n | 1B | 2D n |
|
|
|
|
| Turn underline mode on/off | |
| 0 | n | 2 48 |
| n | 50 |
| ||
|
|
|
|
|
|
|
|
|
|
ESC 2 | 1B | 32 |
|
|
|
|
|
| Select default line spacing |
|
|
|
|
|
|
|
| ||
ESC 3 n | 1B | 33 n | 0 | n |
| 255 | Set line spacing | ||
|
|
|
|
|
|
|
| ||
ESC ? n | 1B | 3F n | 32 |
| n | 126 | Cancel | ||
|
|
|
|
|
|
|
|
|
|
ESC @ | 1B | 40 |
|
|
|
|
|
| Initialize printer |
ESC D n1 nk NUL | 1B | 44 n1 nk 00 |
|
| Set horizontal tab positions | ||||
| 1 | n | 255 0 | k | 32 |
| |||
|
|
|
|
|
|
|
| ||
ESC G n | 1B | 47 n | 0 | n |
| 255 | Turn on/off | ||
|
|
|
|
|
|
| |||
ESC J n | 1B | 4A n | 0 | n | 255 | Print and feed paper | |||
|
|
|
|
|
|
| |||
ESC \ nL nH | 1B | 5C nL nH |
|
|
| Set relative print position | |||
| 0 | nL |
| 255 |
|
|
|
|
|
| 0 | nH |
| 255 |
|
|
|
|
|
|
|
|
|
|
|
|
| ||
ESC c 5 n | 1B | 63 35 n |
|
|
|
| Enable/disable panel buttons | ||
| 0 | n | 255 |
|
|
|
|
| |
|
|
|
|
|
|
|
| ||
ESC d n | 1B | 64 n | 0 |
| n | 255 | Print and feed n lines | ||
|
|
|
|
|
|
| |||
ESC p m t1 t2 | 1B | 70 m t1 t2 |
|
|
| Generate pulse | |||
| m=0,1,48,49 |
|
|
|
|
| |||
| 0 | t1 | 255 | 0 | t2 | 255 |
| ||
|
|
|
|
|
|
|
|
|
|
Command | Code Description | Function Description | |||||||
|
|
| (Hex) |
|
|
|
| ||
GS * x y d1 d(x y 8) | 1D 2A x y d1(x | y | 8) | Define downloaded bit image | |||||
| 1 | x | 255 1 | y | 48 |
| |||
| x | y | 1536 0 | d |
| 255 |
| ||
|
|
|
|
|
|
| |||
GS / m | 1D 2F m |
|
|
|
| Print downloaded bit image | |||
| 0 | m |
| 3 48 |
| m | 51 |
| |
|
|
|
|
|
| ||||
GS L nL nH | 1D 4C nL nH |
|
|
| Set left margin | ||||
| 0 | nL |
| 255 |
|
|
|
|
|
| 0 | nH |
| 255 |
|
|
|
|
|
|
|
|
|
|
|
| |||
GS W nL nH | 1D 57 nL nH |
|
|
|
| Set printing area width | |||
| 0 | nL |
| 255 |
|
|
|
|
|
| 0 | nH |
| 255 |
|
|
|
|
|
|
|
|
|
|
|
| |||
ESC E n | 1B 45 n | 0 | n | 255 |
| Turn emphasized mode on/off | |||
|
|
|
|
|
|
| |||
ESC R n | 1B 52 n | 0 | n | 13 |
| Select an international | |||
|
|
|
|
|
|
|
|
| character set |
|
|
|
|
|
|
|
| ||
ESC a n | 1B 61 n |
|
|
|
|
| Select justification | ||
| 0 | n | 2 48 | n | 50 |
|
| ||
|
|
|
|
|
| ||||
ESC t n | 1B 74 n | 0 | n | 7 n=19 | Select character code table | ||||
|
|
|
|
| |||||
ESC { n | 1B 7B n 0 | n | 255 | Turns on/off | |||||
|
|
|
|
|
|
|
|
| printing mode |
|
|
|
|
|
|
|
| ||
GS H n | 1D 48 n |
|
|
|
|
| Select printing position | ||
| 0 | n | 3 48 | n | 51 |
| for HRI characters | ||
|
|
|
| ||||||
(1) GS V m | 1D 56 m m=0,1,49 |
| Select cut mode and cut paper | ||||||
(2) GS V m n | 1D 56 m n m=66 |
|
|
| |||||
| 0 | n | 255 |
|
|
|
|
| |
|
|
|
|
|
|
| |||
GS h n | 1D 68 n | 1 | n | 255 |
| Select bar code height | |||
|
|
|
|
| |||||
(1) GS k m d1 dk NUL | 1D 6B m d1 | dk 00 |
| Print bar code | |||||
| 0 | m |
| 6 |
|
|
|
|
|
(2) GS k m n d1 dn | 1D 6B m n d1 | dn |
|
| |||||
| 65 | m |
| 73 |
|
|
|
|
|
|
|
| |||||||
GS v 0 m xL xH yL yH | 1D 76 30 m xL xH yL | Print raster bit image | |||||||
d1 dk | yH d1 |
| dk |
|
|
|
|
| |
| 0 | m |
| 3 48 |
| m | 51 |
| |
| 0 | xL |
| 255 0 | xH | 255 |
| ||
| 0 | yL 255 0 d 255 |
| ||||||
| k=(xL+xH 256) (yL+yH |
| |||||||
| 256) |
|
|
|
|
|
|
| |
GS w n | 1D 77 n | 2 | n | 6 |
|
| Set bar code width | ||
|
|
|
|
|
|
|
|
|
|