Skip to content
Samuel Dudley edited this page Dec 9, 2015 · 2 revisions

Printer

Driver Examples

Defining the printer

printer = Printer('/dev/null')  # will use the orthosie driver

# will use the orthosie driver, interface is ignored
printer = Printer({'spool': '/dev/null', 'driver': 'orthosie', 'interface': ''})

# will use the python-escpos driver
printer = Printer({'spool': '192.168.192.168', 'driver': 'escpos', 'interface': 'network'})

Using the printer

kwargs = {'font': 'A', 'align': 'CENTER'}
printer.set(**kwargs)  # set the printer formatting

printer.print_line('Hello World!')  # print text

kwargs = {'mode': 'PART'}
printer.cut(**kwargs)  # this is a part cut

kwargs = {'pin': 2}
printer.kick_drawer(**kwargs)  # draw kick using pin 2

printer.cut()  # this is a full cut