diff --git a/examples/qr_code.py b/examples/qr_code.py new file mode 100644 index 0000000..1fe8448 --- /dev/null +++ b/examples/qr_code.py @@ -0,0 +1,16 @@ +from escpos.printer import Usb + + +if __name__ == '__main__': + + # Adapt to your needs + p = Usb(0x0416, 0x5011, profile="POS-5890") + + # Some software barcodes + p.set(align='left') + + p.text("hello\n") + + p.qr("https://github.com/python-escpos/python-escpos") + + p.text("world\n") \ No newline at end of file diff --git a/src/escpos/escpos.py b/src/escpos/escpos.py index 0af1e55..f319ea3 100644 --- a/src/escpos/escpos.py +++ b/src/escpos/escpos.py @@ -203,7 +203,10 @@ class Escpos(object): qr_img = qr_code.make_image() im = qr_img._img.convert("RGB") # Convert the RGB image in printable image + self.text('\n') self.image(im) + self.text('\n') + self.text('\n') return # Native 2D code printing cn = b'1' # Code type for QR code