Skip to content

Instantly share code, notes, and snippets.

@ZdenekM
Created January 3, 2020 13:46
Show Gist options
  • Save ZdenekM/f37d9c6388a9041469edb9c0618ad454 to your computer and use it in GitHub Desktop.
Save ZdenekM/f37d9c6388a9041469edb9c0618ad454 to your computer and use it in GitHub Desktop.
Brother QL-700: print QR code example
from brother_ql.conversion import convert
from brother_ql.backends.helpers import send
from brother_ql.raster import BrotherQLRaster
import qrcode
PX_WIDTH = 696
qr = qrcode.make('ARCOR2')
img = qr.get_image()
img = img.resize((PX_WIDTH, PX_WIDTH))
qlr = BrotherQLRaster("QL-700")
qlr.exception_on_warning = True
send(instructions=convert(qlr, [img], "62"), printer_identifier="usb://0x04f9:0x2042", backend_identifier="pyusb", blocking=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment