Created
March 5, 2018 21:16
-
-
Save driscollis/426e5a1e916dfcf278e2ba56376e7023 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # eanbc_demo.py | |
| from reportlab.graphics.barcode import eanbc | |
| from reportlab.platypus import SimpleDocTemplate | |
| from reportlab.platypus import Paragraph | |
| from reportlab.lib.styles import getSampleStyleSheet | |
| def eanbc_demo(barcode_value): | |
| doc = SimpleDocTemplate('eanbc_demo.pdf') | |
| styles = getSampleStyleSheet() | |
| flowables = [] | |
| flowables.append(Paragraph('EAN-8 code:', | |
| style=styles['Normal'])) | |
| barcode = eanbc.Ean8BarcodeWidget(barcode_value) | |
| flowables.append(barcode) | |
| doc.build(flowables) | |
| if __name__ == "__main__": | |
| eanbc_demo('123456789') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment