1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-09-13 09:09:58 +00:00

Implement printer-side rendering of QR codes for printers that support it.

Expand settings on escpos.qr to include ec, size,
model and 'native' (send image or send esc/pos QR command).

Default is set as native=False, so existing code will continue to
render QR codes as images.
This commit is contained in:
Michael Billington
2016-03-20 00:48:29 +11:00
parent bf3012b882
commit f39c4227ec
3 changed files with 167 additions and 12 deletions

View File

@@ -183,6 +183,16 @@ BARCODE_TYPES = {
'B': BARCODE_TYPE_B,
}
## QRCode error correction levels
QR_ECLEVEL_L = 0;
QR_ECLEVEL_M = 1;
QR_ECLEVEL_Q = 2;
QR_ECLEVEL_H = 3;
## QRcode models
QR_MODEL_1 = 1;
QR_MODEL_2 = 2;
QR_MICRO = 3;
# Image format
# NOTE: _PRINT_RASTER_IMG is the obsolete ESC/POS "print raster bit image"