From 2a8f852c689bc29869b6a763748f9a06f6f5154a Mon Sep 17 00:00:00 2001 From: Stephan Sokolow Date: Thu, 22 May 2014 01:41:02 -0400 Subject: [PATCH] Ensure QR codes have a border large enough for successful scan (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) --- escpos/escpos.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/escpos/escpos.py b/escpos/escpos.py index ed83493..661baeb 100644 --- a/escpos/escpos.py +++ b/escpos/escpos.py @@ -152,7 +152,10 @@ class Escpos: qr_img = qr_code.make_image() # Convert the RGB image in printable image im = qr_img._img.convert("RGB") + self.text('\n') + self.set(align='center') self.image(im) + self.text('\n') def barcode(self, code, bc, height, width, pos, font): """ Print Barcode """