Escpos inherits its methods to the printers. the following methods are defined:
Prints an image. Its adjust the size in order to print it.
image_name.ext is the complete file name and location of any image type (jpg, gif, png, bmp) Raises ImageSizeError exception.
Prints a QR code. The size has been adjuested to Version 4, so it can be enough small to be printed but also enough big to be read by a smartphone.
text Any text that needs to be QR encoded. It could be a slogan, salutation, url, etc.
Prints a barcode.
code is an alphanumeric code to be printed as bar code barcode_type must be one of the following type of codes:
- UPC-A
- UPC-E
- EAN13
- EAN8
- CODE39
- ITF
- NW7
width is a numeric value in the range between (1,255) Default: 64 height is a numeric value in the range between (2,6) Default: 3 position is where to place the code around the bars, could be one of the following values:
- ABOVE
- BELOW
- BOTH
- OFF
Default: BELOW
font is one of the 2 type of fonts, values could be:
- A
- B
Default: A
Raises BarcodeTypeError, BarcodeSizeError, BarcodeCodeError exceptions.
Prints raw text. Raises TextError exception.
Set text properties.
align set horizontal position for text, the possible values are:
- CENTER
- LEFT
- RIGHT
Default: left
font type could be A or B. Default: A width is a numeric value, 1 is for regular size, and 2 is twice the standard size. Default: 1 height is a numeric value, 1 is for regular size and 2 is twice the standard size. Default: 1
Cut paper.
mode set a full or partial cut. Default: full Partial cut is not implemented in all printers.
Sends a pulse to the cash drawer in the specified pin.
pin is a numeric value which defines the pin to be used to send the pulse, it could be 2 or 5. Raises CashDrawerError()
Hardware operations.
operation is any of the following options:
- INIT
- SELECT
- RESET
Carrier feed and tabs.
align is a string which takes any of the following values:
- LF for Line Feed
- FF for Form Feed
- CR for Carriage Return
- HT for Horizontal Tab
- VT for Vertical Tab