ThermalPrinter Documentation Release latest

Tiger-222

May 06, 2018

Contents

1 Installation 2

2 Setup 2

3 Usage 2

4 Tools 2

5 ThermalPrinter API 2

6 Developers 2

7 Indices and tables 3

Python Module Index 5

ii Python module to manage the DP-EH600 thermal printer (the one sold by AdaFruit). • Python 3+ only and PEP 8 compliant; • this is a clean follow of the technical manual with few helpers; • get the source code on GitHub; • and report a bug; • also several useful recipes; • contibutors are welcome, check the developer guide!

1 ThermalPrinter Documentation, Release latest

Content

CHAPTER 1

Installation

1.1 Dependencies

The only dependency is pySerial (version 3.0+): python3 -m pip install --upgrade --user pyserial For Python < 3.4, you will need to install Enum too: python3 -m pip install --upgrade --user enum34

1.2 Recommended way

Quite simple: python3 -m pip install --upgrade --user thermalprinter

1.3 From sources

Alternatively, you can get a copy of the module from GitHub. 1. Clone the repository: git clone https://github.com/BoboTiG/thermalprinter.git cd thermalprinter 2. Install them module: python3 setup.py install --user

CHAPTER 2

2 Contents

Setup

2.1 Raspberry

Note : tested on Raspberry Pi 2 and 3. 1. Ensure that ttyAMA0 is not used for serial console access. Edit the file /boot/cmdline.txt to remove all name-value pairs containing ttyAMA0. 2. Add the user to the dialout group: sudo usermod -a -G dialout USER 3. Reboot.

2.2 Beagle Bone

Note : documentation retrieved from luopio/py-thermal-printer and has not been tested. # Mux settings echo1 > /sys/kernel/debug/omap_mux/spi0_sclk echo1 > /sys/kernel/debug/omap_mux/spi0_d0

2.3 Other?

If you work with another hardware, please tell us:)

CHAPTER 3

Usage

An example is better than thousands words: from PIL import Image from ThermalPrinter import *

with ThermalPrinter(port='/dev/ttyAMA0') as printer: # Picture printer.image(Image.open('gnu.png'))

# Bar codes printer.barcode_height(80) printer.barcode_position(BarCodePosition.BELOW) printer.barcode_width(3) printer.barcode('012345678901', BarCode.EAN13)

# Styles printer.out('Bold', bold=True) printer.out('Double height', double_height=True) printer.out('Double width', double_width=True) printer.out('Inverse', inverse=True) printer.out('Rotate 90°', rotate=True, codepage=CodePage.ISO_8859_1) printer.out('Strike', strike=True) printer.out('Underline', underline=1) printer.out('Upside down', upside_down=True)

# Chinese (almost all alphabets exist) printer.out('', chinese=True, chinese_format=Chinese.UTF_8)

# Greek (excepted the character) printer.out('Σ휏휂휈 휐훾휖휄 휇훼!', codepage=CodePage.CP737)

# Accents printer.out('Voilà !', justify='C', strike=True, underline=2, codepage=CodePage.ISO_8859_1)

# Line feeds printer.feed(2)

3.1 Instance the class

Import the module: from thermalprinter import ThermalPrinter So the module can used as simply as: with ThermalPrinter() as printer: # ... Or: printer= ThermalPrinter()

CHAPTER 4

Tools

Few helpers, and they are free :)

4.1 Constants

thermalprinter.tools.ls(*constants) Parameters *constants (list) – constants to print. Print a list of constants and their values. >>> ls() All constants will be printed here. You can print only constants you want too: >>> from thermalprinter.constants import Chinese, CodePage

>>> ls(Chinese) Chinese values will be prited here.

>>> ls(Chinese, CodePage) Chinese and CodePage values will be prited here.

4.2 Tests

thermalprinter.tools.testing(port=’/dev/ttyAMA0’, heat_time=80) Parameters • port (str) – serial port to use, known as the device name. • heat_time (int) – printer heat time. Send to the printer several insctructions to test every printing functions.

4.3 Code pages

thermalprinter.tools.test_char(char) Parameters char (bytes) – bytes to print. Test one character with all possible . Say you are looking for the good code page to print a sequence, you can print it using every code pages: >>> test_char(b'') This function is as simple as: for codepage in list(CodePage): printer.out('{}: {}'.format(codepage.name, char), codepage=codepage)

4.4 Data validation

These are special functions to handle data validation. As it could take a lot of lines and logic, we prefered create them outsite the class to keep a light code for every ThermalPrinter’s methods. thermalprinter.validate.validate_barcode(data, barcode_type) → None Parameters • data (mixed) – data to print. • barecode_type (BarCode) – bar code type to use. Raises • ThermalPrinterValueError – On incorrect data’s type or value. • ThermalPrinterConstantError – On bad barecode_type’s type. Validate data against the bar code type. thermalprinter.validate.validate_barcode_position(position) → None Parameters position (BarCodePosition) – the position to use. Raises ThermalPrinterConstantError – On bad position’s type. Validate a bar code position. thermalprinter.validate.validate_charset(charset) → None Parameters charset (CharSet) – new charset to use. Raises ThermalPrinterConstantError – On bad charset’s type. Validate a charset. thermalprinter.validate.validate_chinese_format(fmt) → None Parameters fmt (Chinese) – new format to use. Raises ThermalPrinterConstantError – On bad fmt’s type. Validate a Chinese format. thermalprinter.validate.validate_codepage(codepage) → None Parameters codepage (CodePage) – new code page to use. Raises ThermalPrinterConstantError – On bad codepage’s type. Validate a code page.

CHAPTER 5

ThermalPrinter API

5.1 Class

class thermalprinter.ThermalPrinter

__init__(port=’/dev/ttyAMA0’, baudrate=19200, **kwargs) Parameters • port (str) – Serial port to use, known as the device name. • baudrate (int) – Baud rate such as 9600 or 115200 etc. • **kwargs (dict) – Additionnal optional arguments: – heat_time (int): printer heat time (default: 80); – heat_interval (int): printer heat time interval (default: 12); – most_heated_point (int): for the printer, the most heated point (default: 3). Raises ThermalPrinterValueError – On incorrect argument’s type or value.

5.2 Methods

5.2.1 Bar codes class thermalprinter.ThermalPrinter

barcode(data, barecode_type) → None Parameters • data (mixed) – data to print. • barecode_type (BarCode) – bar code type to use. Raises • ThermalPrinterValueError – On incorrect data’s type or value. • ThermalPrinterConstantError – On bad barecode_type’s type. Bar code printing. All checks are done to ensure the data validity. barcode_height(height=162) → None Parameters height (int) – bar code height (min=1, max=255). Raises ThermalPrinterValueError – On incorrect height’s type or value. Set the bar code height. barcode_left_margin(margin=0) → None Parameters margin (int) – left margin (min=0, max=255). Raises ThermalPrinterValueError – On incorrect margin’s type or value. Set the left margin of the bar code. barcode_position(position=BarCodePosition.HIDDEN) → None Parameters position (BarCodePosition) – the position to use. Raises ThermalPrinterConstantError – On bad position’s type. Set the position of the text relative to the bar code. barcode_width(width=3) → None Parameters width (int) – bar code with (min=2, max=6). Raises ThermalPrinterValueError – On incorrect width’s type or value. Set the bar code width.

5.2.2 Images class thermalprinter.ThermalPrinter

image(image) → None Parameters image (Image) – the image to print. Raises ThermalPrinterValueError – On bad image’s type. Print Image. Requires Python Imaging Library. Image will be cropped to 384 pixels width if necessary, and converted to 1-bit w/diffusion dithering. For any other behavior (scale, B&W threshold, etc.), use the Imaging Library to perform such operations before passing the result to this function. Max width: 384px. >>> from PIL import Image >>> printer.image(Image.open('picture.png'))

5.2.3 Text styling class thermalprinter.ThermalPrinter

bold(state=False) → None Parameters state (bool) – new state. Turn emphasized mode on/off. char_spacing(spacing=0) → None Parameters spacing (int) – spacing to use (min=0, max=255). Raises ThermalPrinterValueError – On incorrect spacing’s type or value. Set the right character spacing. double_height(state=False) → None Parameters state (bool) – new state. Set double height mode. double_width(state=False) → None Parameters state (bool) – new state. Select double width mode. inverse(state=False) → None Parameters state (bool) – new state. Turn white/black reverse printing mode. justify(value=’L’) → None Parameters value (str) – the new justification. Raises ThermalPrinterValueError – On incorrect value’s type or value. Set text justification: • left (L) • center (C) • right (R) left_margin(margin=0) → None Parameters margin (int) – the new margin (min=0, max=47). Raises ThermalPrinterValueError – On incorrect margin’s type or value. Set the left margin. line_spacing(spacing=30) → None Parameters spacing (int) – the new spacing (min=0, max=255). Raises ThermalPrinterValueError – On incorrect spacing’s type or value. Set line spacing. rotate(state=False) → None Parameters state (bool) – new state. Turn on/off clockwise rotation of 90°. size(value=’S’) → None Parameters value (str) – the new text size. Raises ThermalPrinterValueError – On incorrect value’s type or value. Set text size: • small (S) • medium: double height (M) • large: double width and height (L) This method affects max_column. strike(state=False) → None Parameters state (bool) – new state. Turn on/off double-strike mode. underline(weight=0) → None Parameters weight (int) – the underline’s weight (min=0, max=2). Raises ThermalPrinterValueError – On incorrect weight’s type or value. Turn underline mode on/off: • 0: turns off underline mode • 1: turns on underline mode (1 dot thick) • 2: turns on underline mode (2 dots thick) upside_down(state=False) → None Parameters state (bool) – new state. Turns on/off upside-down printing mode.

5.2.4 Encoding and charsets class thermalprinter.ThermalPrinter

charset(charset=CharSet.USA) → None Parameters charset (CharSet) – new charset to use. Raises ThermalPrinterConstantError – On bad charset’s type. Select an internal character set. codepage(codepage=CodePage.CP437) → None Parameters codepage (CodePage) – new code page to use. Raises ThermalPrinterConstantError – On bad codepage’s type. Select character code table.

5.2.5 Chinese class thermalprinter.ThermalPrinter

chinese(state=False) → None Parameters state (bool) – new state. Select/cancel Chinese mode. chinese_format(fmt=Chinese.GBK) → None Parameters fmt (Chinese) – new format to use. Raises ThermalPrinterConstantError – On bad fmt’s type. Selection of the Chinese format.

5.2.6 Printing class thermalprinter.ThermalPrinter

feed(number=1) → None Parameters number (int) – number of lines. Raises ThermalPrinterValueError – On incorrect number’s type or value. Feeds by the specified number of lines (min=0, max=255). out(data, line_feed=True, **kwargs) → None Parameters • data (mixed) – the data to print. • line_feed (bool) – send a line break after the printed data. • **kwargs (dict) – additional styles to apply. Send a line to the printer. You can pass formatting instructions directly via arguments: >>> printer.out(data, justify='C', inverse=True) This will prevent you to do: >>> printer.justify('C') >>> printer.inverse(True) >>> printer.out(data) >>> printer.inverse(False) >>> printer.justify('L')

5.2.7 Printer state class thermalprinter.ThermalPrinter

offline() → None Take the printer offline. Print commands sent after this will be ignored until offline() is called. online() → None Take the printer online. Subsequent print commands will be obeyed. sleep(seconds=1) → None Parameters seconds (int) – value to pass to the printer (min=0, unit=sec). Raises ThermalPrinterValueError – On incorrect seconds’s type or value. Put the printer into a low-energy state. status() → dict Check the printer status. If RX pin is not connected, all values will be set to True. Return a dict: • movement: False if the movement is not connected; • paper: False is no paper; • temp: False if the temperature exceeds 60°C; • voltage: False if the voltage is higher than 9.5V. reset() → None Reset the printer to factory defaults. test() → None Print the test page (contains printer’s settings). wake() → None Wake up the printer.

5.2.8 Special methods class thermalprinter.ThermalPrinter

send_command(*args) → None Parameters *args (list) – command and arguments for the printer. Raw byte-writing. to_bytes(data) → bytes Parameters data (mixed) – any type of data to print. Convert data before sending to the printer.

5.3 Attributes

All these attributes are read-only. class thermalprinter.ThermalPrinter

feeds Getter Number of printed line feeds since the start of the script. Type int Raises ThermalPrinterAttributeError – When trying to assign a value. is_online Getter The printer is online. Type bool Raises ThermalPrinterAttributeError – When trying to assign a value. is_sleeping Getter The printer is sleeping. Type bool Raises ThermalPrinterAttributeError – When trying to assign a value. lines Getter Number of printed lines since the start of the script. Type int Raises ThermalPrinterAttributeError – When trying to assign a value. max_column Getter Number of printable characters on one line. Type int Raises ThermalPrinterAttributeError – When trying to assign a value.

5.4 Exceptions

exception thermalprinter.ThermalPrinterError Base class for thermal printer exceptions. exception thermalprinter.ThermalPrinterAttributeError Exception that is raised when trying to assign something to a read-only attribute. exception thermalprinter.ThermalPrinterConstantError Exception that is raised on inexistant or out of range constant. exception thermalprinter.ThermalPrinterValueError Exception that is raised on incorrect type or value passed to any method.

5.5 Constants

5.5.1 Bar codes types BarCode.UPC_A BarCode.UPC_E BarCode.JAN13 BarCode.JAN8 BarCode.CODE39 BarCode.ITF BarCode.CODABAR BarCode.CODE93 BarCode.CODE128

5.5.2 Bar codes positions BarCodePosition.HIDDEN BarCodePosition.ABOVE BarCodePosition.BELOW BarCodePosition.BOTH

5.5.3 Characters sets CharSet.USA CharSet.FRANCE CharSet.GERMANY CharSet.UK CharSet.DENMARK CharSet.SWEDEN CharSet.ITALY CharSet.SPAIN CharSet.JAPAN CharSet.NORWAY CharSet.DENMARK2 CharSet.SPAIN2 CharSet.LATIN_AMERICAN CharSet.KOREA CharSet.SLOVENIA CharSet.CHINA

5.5.4 Chinese formats Chinese.GBK Chinese.UTF_8 Chinese.

5.5.5 Code pages CodePage.CP437 the United States of America, European standard CodePage.CP932 Katakana CodePage.CP850 Multi language CodePage.CP860 Portuguese CodePage.CP863 Canada, French CodePage.CP865 Western Europe CodePage.CYRILLIC The Slavic language CodePage.CP866 The Slavic 2 CodePage.MIK The Slavic / Bulgaria CodePage.CP755 Eastern Europe, Latvia 2 CodePage.IRAN Iran, Persia CodePage.CP862 Hebrew CodePage.CP1252 Latin 1 [WCP1252] CodePage.CP1253 Greece [WCP1253] CodePage.CP852 Latina 2 CodePage.CP858 A variety of language Latin 1 + Europe CodePage.IRAN2 Persian CodePage.LATVIA CodePage.CP864 Arabic CodePage.ISO_8859_1 Western Europe CodePage.CP737 Greece CodePage.CP1257 The Baltic Sea CodePage.THAI Thai Wen CodePage.CP720 Arabic CodePage.CP855 CodePage.CP857 Turkish CodePage.CP1250 Central Europe [WCP1250] CodePage.CP775 CodePage.CP1254 Turkish [WCP1254] CodePage.CP1255 Hebrew [WCP1255] CodePage.CP1256 Arabic [WCP1256] CodePage.CP1258 Vietnamese [WCP1258] CodePage.ISO_8859_2 Latin 2 CodePage.ISO_8859_3 Latin 3 CodePage.ISO_8859_4 Baltic languages CodePage.ISO_8859_5 The Slavic language CodePage.ISO_8859_6 Arabic CodePage.ISO_8859_7 Greece CodePage.ISO_8859_8 Hebrew CodePage.ISO_8859_9 Turkish CodePage.ISO_8859_15 : Latin 9 CodePage.THAI2 Thai Wen 2 CodePage.CP856 CodePage.CP874

5.5.6 Code pages fallback Certain code pages are not available on Python, so we use a little translation table. If you find a better fit for one of the code page below, open an issue please (or send a patch). CodePageConverted.MIK ISO8859-5 CodePageConverted.CP755 UTF-8 CodePageConverted.IRAN CP1256 CodePageConverted.IRAN2 UTF-8 CodePageConverted.LATVIA ISO8859-4 CodePageConverted.THAI ISO8859-11 CodePageConverted.THAI2 UTF-8

CHAPTER 6

Developers

6.1 Setup

1. First, you need to fork the GitHub repository. Note : always work on a specific branch dedicated to your patch. 2. Then, you could need the Embedded printer DP-EH600 Technical Manual and take a look at the features advancement. 3. Finally, be sure to add/update tests and documentation within your patch.

6.2 Testing

6.2.1 Dependency You will need pytest: python3 -m pip install --upgrade --user pytest

6.2.2 Adding/changing a method Before all, you will add a test file for the new method. Then, there is a test file called test_methods.py where all functions signatures are specified. Here is a little help to add a new one. 1. Say we want to find the signature of the size function: >>> from thermalprinter import ThermalPrinter >>> from inspect import getargspec

>>> getargspec(ThermalPrinter.size) ArgSpec(args=['self', 'value'], varargs=None, keywords=None, defaults=('S',)) 2. Copy the all line ArgSpec(...). 3. Open the test_methods.py file and add a new test case, keep it sorted: # Syntax of the function's name: test_signature_FUNCTION def test_signature_size(methods): methods.remove(extract_stack(None,2)[1][2].replace('test_signature_',''))

# Here, you paste the ArgSpec(...) line sig= ArgSpec(args=['self','value'], varargs=None, keywords=None, defaults=('S',))

# And here you use the function's name too assert getargspec(ThermalPrinter.size) == sig To summary, there are 3 modifications to apply, all functions in this file use the same syntax.

6.2.3 How to test? Enable the developer mode: python3 setup.py develop Lauch the test suit: python3 -m pytest And you can test printing functions (if you added a styling method, you can add it to this function).

6.3 Validating the code

It is important to keep a clean base code. Use tools like flake8 and Pylint.

6.3.1 Dependencies Install required packages: python3 -m pip install --upgrade --user flake8 pylint

6.3.2 How to validate?

flake8 pylint3 thermalprinter If there is no output, you are good ;)

6.4 Documentation

6.4.1 Dependencies You will need Sphinx: python3 -m pip install --upgrade --user sphinx

6.4.2 How to build?

cd docs make clean html CHAPTER 7

Indices and tables

• genindex • search

3 ThermalPrinter Documentation, Release latest

4 Chapter 7. Indices and tables Python Module Index

t thermalprinter,2 thermalprinter.tools,2 thermalprinter.validate,2

5 ThermalPrinter Documentation, Release latest

6 Python Module Index Index

Symbols CharSet.LATIN_AMERICAN (in module thermal- __init__() (thermalprinter.ThermalPrinter method),2 printer),2 CharSet.NORWAY (in module thermalprinter),2 B CharSet.SLOVENIA (in module thermalprinter),2 CharSet.SPAIN (in module thermalprinter),2 barcode() (thermalprinter.ThermalPrinter method),2 CharSet.SPAIN2 (in module thermalprinter),2 BarCode.CODABAR (in module thermalprinter),2 CharSet.SWEDEN (in module thermalprinter),2 BarCode.CODE128 (in module thermalprinter),2 CharSet.UK (in module thermalprinter),2 BarCode.CODE39 (in module thermalprinter),2 CharSet.USA (in module thermalprinter),2 BarCode.CODE93 (in module thermalprinter),2 chinese() (thermalprinter.ThermalPrinter method),2 BarCode.ITF (in module thermalprinter),2 Chinese.BIG5 (in module thermalprinter),2 BarCode.JAN13 (in module thermalprinter),2 Chinese.GBK (in module thermalprinter),2 BarCode.JAN8 (in module thermalprinter),2 Chinese.UTF_8 (in module thermalprinter),2 BarCode.UPC_A (in module thermalprinter),2 chinese_format() (thermalprinter.ThermalPrinter BarCode.UPC_E (in module thermalprinter),2 method),2 barcode_height() (thermalprinter.ThermalPrinter codepage() (thermalprinter.ThermalPrinter method),2 method),2 CodePage.CP1250 (in module thermalprinter),2 barcode_left_margin() (thermalprinter.ThermalPrinter CodePage.CP1252 (in module thermalprinter),2 method),2 CodePage.CP1253 (in module thermalprinter),2 barcode_position() (thermalprinter.ThermalPrinter CodePage.CP1254 (in module thermalprinter),2 method),2 CodePage.CP1255 (in module thermalprinter),2 barcode_width() (thermalprinter.ThermalPrinter method), CodePage.CP1256 (in module thermalprinter),2 2 CodePage.CP1257 (in module thermalprinter),2 BarCodePosition.ABOVE (in module thermalprinter),2 CodePage.CP1258 (in module thermalprinter),2 BarCodePosition.BELOW (in module thermalprinter),2 CodePage.CP437 (in module thermalprinter),2 BarCodePosition.BOTH (in module thermalprinter),2 CodePage.CP720 (in module thermalprinter),2 BarCodePosition.HIDDEN (in module thermalprinter),2 CodePage.CP737 (in module thermalprinter),2 bold() (thermalprinter.ThermalPrinter method),2 CodePage.CP755 (in module thermalprinter),2 C CodePage.CP775 (in module thermalprinter),2 CodePage.CP850 (in module thermalprinter),2 char_spacing() (thermalprinter.ThermalPrinter method),2 CodePage.CP852 (in module thermalprinter),2 charset() (thermalprinter.ThermalPrinter method),2 CodePage.CP855 (in module thermalprinter),2 CharSet.CHINA (in module thermalprinter),2 CodePage.CP856 (in module thermalprinter),2 CharSet.DENMARK (in module thermalprinter),2 CodePage.CP857 (in module thermalprinter),2 CharSet.DENMARK2 (in module thermalprinter),2 CodePage.CP858 (in module thermalprinter),2 CharSet.FRANCE (in module thermalprinter),2 CodePage.CP860 (in module thermalprinter),2 CharSet.GERMANY (in module thermalprinter),2 CodePage.CP862 (in module thermalprinter),2 CharSet.ITALY (in module thermalprinter),2 CodePage.CP863 (in module thermalprinter),2 CharSet.JAPAN (in module thermalprinter),2 CodePage.CP864 (in module thermalprinter),2 CharSet.KOREA (in module thermalprinter),2 CodePage.CP865 (in module thermalprinter),2

7 ThermalPrinter Documentation, Release latest

CodePage.CP866 (in module thermalprinter),2 ls() (in module thermalprinter.tools),2 CodePage.CP874 (in module thermalprinter),2 CodePage.CP932 (in module thermalprinter),2 M CodePage.CYRILLIC (in module thermalprinter),2 max_column (thermalprinter.ThermalPrinter attribute),2 CodePage.IRAN (in module thermalprinter),2 CodePage.IRAN2 (in module thermalprinter),2 CodePage.ISO_8859_1 (in module thermalprinter),2 offline() (thermalprinter.ThermalPrinter method),2 CodePage.ISO_8859_15 (in module thermalprinter),2 online() (thermalprinter.ThermalPrinter method),2 CodePage.ISO_8859_2 (in module thermalprinter),2 out() (thermalprinter.ThermalPrinter method),2 CodePage.ISO_8859_3 (in module thermalprinter),2 CodePage.ISO_8859_4 (in module thermalprinter),2 P CodePage.ISO_8859_5 (in module thermalprinter),2 CodePage.ISO_8859_6 (in module thermalprinter),2 Python Enhancement Proposals CodePage.ISO_8859_7 (in module thermalprinter),2 PEP 8,1 CodePage.ISO_8859_8 (in module thermalprinter),2 R CodePage.ISO_8859_9 (in module thermalprinter),2 CodePage.LATVIA (in module thermalprinter),2 reset() (thermalprinter.ThermalPrinter method),2 CodePage.MIK (in module thermalprinter),2 rotate() (thermalprinter.ThermalPrinter method),2 CodePage.THAI (in module thermalprinter),2 CodePage.THAI2 (in module thermalprinter),2 S CodePageConverted.CP755 (in module thermalprinter),2 send_command() (thermalprinter.ThermalPrinter CodePageConverted.IRAN (in module thermalprinter),2 method),2 CodePageConverted.IRAN2 (in module thermalprinter), size() (thermalprinter.ThermalPrinter method),2 2 sleep() (thermalprinter.ThermalPrinter method),2 CodePageConverted.LATVIA (in module thermal- status() (thermalprinter.ThermalPrinter method),2 printer),2 strike() (thermalprinter.ThermalPrinter method),2 CodePageConverted.MIK (in module thermalprinter),2 CodePageConverted.THAI (in module thermalprinter),2 T CodePageConverted.THAI2 (in module thermalprinter),2 test() (thermalprinter.ThermalPrinter method),2 test_char() (in module thermalprinter.tools),2 D testing() (in module thermalprinter.tools),2 double_height() (thermalprinter.ThermalPrinter method), ThermalPrinter (class in thermalprinter),2 2 thermalprinter (module),2 double_width() (thermalprinter.ThermalPrinter method), thermalprinter.tools (module),2 2 thermalprinter.validate (module),2 ThermalPrinterAttributeError,2 F ThermalPrinterConstantError,2 feed() (thermalprinter.ThermalPrinter method),2 ThermalPrinterError,2 feeds (thermalprinter.ThermalPrinter attribute),2 ThermalPrinterValueError,2 to_bytes() (thermalprinter.ThermalPrinter method),2 I image() (thermalprinter.ThermalPrinter method),2 inverse() (thermalprinter.ThermalPrinter method),2 underline() (thermalprinter.ThermalPrinter method),2 is_online (thermalprinter.ThermalPrinter attribute),2 upside_down() (thermalprinter.ThermalPrinter method), is_sleeping (thermalprinter.ThermalPrinter attribute),2 2 J V justify() (thermalprinter.ThermalPrinter method),2 validate_barcode() (in module thermalprinter.validate),2 validate_barcode_position() (in module thermal- L printer.validate),2 validate_charset() (in module thermalprinter.validate),2 left_margin() (thermalprinter.ThermalPrinter method),2 validate_chinese_format() (in module thermal- line_spacing() (thermalprinter.ThermalPrinter method),2 printer.validate),2 lines (thermalprinter.ThermalPrinter attribute),2

8 Index ThermalPrinter Documentation, Release latest validate_codepage() (in module thermalprinter.validate), 2 W wake() (thermalprinter.ThermalPrinter method),2

Index 9