Skip to content

Instantly share code, notes, and snippets.

View lkrone's full-sized avatar

lkrone

  • Hamburg, Germany
  • 01:30 (UTC +01:00)
View GitHub Profile
@lkrone
lkrone / ean13-label-sheet.py
Created December 16, 2016 22:43
Shows a way to generate a PDF (with Python and ReportLab) of a sheet of labels containing EAN-13 Barcodes and a short, descriptive text.
#!/usr/bin/env python3
from reportlab.lib.pagesizes import A4
from reportlab.graphics.shapes import Drawing, String
from reportlab.graphics.barcode.eanbc import Ean13BarcodeWidget
from reportlab.graphics import renderPDF
from reportlab.pdfgen.canvas import Canvas
"""
Adjust pagesize, number of labels, barcode size and