1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-08-24 09:03:34 +00:00

Ensure QR codes have a border large enough (#235)

*  Ensure QR codes have a border large enough
(The QR code spec requires a border at least 4*box_size thick but we can't
 just set border=16 because that results in a QR code more than 255px tall
 and I'm not yet ready to use fullimage() as a backend for it)
This fix was originally commited by Stephan Sokolow on 2014-05-22
* Let the user print stuff using qr example
* fix tests
This commit is contained in:
Romain Porte
2017-07-24 15:04:54 +02:00
committed by Patrick Kanzler
parent 89dfb6cf86
commit 5bd6dcf471
3 changed files with 26 additions and 2 deletions

19
examples/qr_code.py Normal file
View File

@@ -0,0 +1,19 @@
import sys
from escpos.printer import Usb
def usage():
print("usage: qr_code.py <content>")
if __name__ == '__main__':
if len(sys.argv) != 2:
usage()
sys.exit(1)
content = sys.argv[1]
# Adapt to your needs
p = Usb(0x0416, 0x5011, profile="POS-5890")
p.qr(content)