cross-reader/escpos.py
2019-03-13 15:45:58 +01:00

56 lines
1.4 KiB
Python
Executable File

#!/usr/bin/env python3
# https://reliance-escpos-commands.readthedocs.io/en/latest/layout.html#d57
escpos = {
"init_printer": "\x1B\x40",
"select_INT_character_set": "\x1B\x52\x00",
"select_FR_character_set": "\x1B\x52\x01",
"select_character_code_table": "\x1B\x74\x28",
"justify_left": "\x1B\x61\x00",
"justify_center": "\x1B\x61\x01",
"justify_right": "\x1B\x61\x02",
'doubleprinting_on': "\x1B\x47\x01",
'doubleprinting_off': "\x1B\x47\x00",
'inverted_on': "\x1D\x42\x01",
'inverted_off': "\x1D\x42\x00",
'large_w': "\x1D\x21\x70",
'large_h': "\x1D\x21\x07",
'margin_left': "\x1D\x4C\x15\x00",
'print_area': "\x1D\x57\x80\x00",
'font_a': "\x1B\x4D\x00",
'font_b': "\x1B\x4D\x01",
'largefont': "\x1B\x21\x70",
'mediumfont': "\x1B\x21\x10",
'normalfont': "\x1B\x21\x00",
'bold': "\x1B\x21\x08",
'reset': "\x1B\x21\x00",
'space_btw_letters_0L': '\x1B\x20\x00', # n [0,255]
'space_btw_letters_5L': '\x1B\x20\x05', # n [0,255]
'space_btw_letters_10L': '\x1B\x20\x10', # n [0,255]
'space_btw_letters_20L': '\x1B\x20\x20', # n [0,255]
'paperfeed_1l': '\x1B\x64\x01' ,
'paperfeed_10l': '\x1B\x64\x10' ,
'papercut':'\x1D\x56\x00',
'direction_0': '\x1B\x56\x00' ,
'direction_90': '\x1B\x56\x01' ,
'reverse_print_on': '\x1D\x42\x01',
'reverse_print_off': '\x1D\x42\x00',
'pagedefault': '\x1B\x53' , #?
}