Skip to main content

# Barcode Printer for Django

This is a reusable Django application which generates PDF barcodes in various formats with a human and machine (OCR-A) readable textual label.

These barcodes are rendered as a PDF with embedded JavaScript which prompts the PDF to be immediately printed.

Currently this is used by [Adlibre DMS](http://www.adlibre.com.au/adlibre-dms/) for document barcode generation, but this application is generic and can be reused in any Django app that requires barcode printing.

[ReportLab](http://www.reportlab.com) is used for the barcode generation. And the following formats are supported:

  • Code39 (3 of 9),

  • Code128.

However it would be trivial to add support for any format that ReportLab supports.

## Example

Barcode automatically printing from URL:

![Barcode Printer for Django - Automatic Printing](https://github.com/adlibre/django-bcp/raw/master/docs/example.png)

## Installation

If you use pip then the dependencies and requirements will be taken care of:

Prod:

pip install git+git://github.com/adlibre/django-bcp.git

Dev:

pip install -e git+git@github.com:adlibre/django-bcp.git#egg=bcp

## N.B. ReportLab Bug

ReportLab 2.5/2.6 has a typo. “OpenActions” should be “OpenAction” as per ISO 32000-1:2008.

<pre> diff -r broken/lib/python2.7/site-packages/reportlab/pdfbase/pdfdoc.py fixed/lib/python2.7/site-packages/reportlab/pdfbase/pdfdoc.py 1022c1022 &lt; Dests Outlines Pages Threads AcroForm Names OpenActions PageMode URI — &gt; Dests Outlines Pages Threads AcroForm Names OpenAction PageMode URI </pre>

You will need to manually patch this, otherwise the barcode will not automatically print:

sed -i -e ‘s@OpenActions@OpenAction@g’ lib/python*/site-packages/reportlab/pdfbase/pdfdoc.py

Metadata

Release files for django-bcp 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-bcp 0.2.2
File Size Uploaded Provenance Actions
django-bcp-0.2.2.tar.gz 19.5 kB Without provenance Details for django-bcp-0.2.2.tar.gz

Release files / django-bcp-0.2.2.tar.gz

Download URL django-bcp-0.2.2.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
efdc2212a8218da7aa341f189d426d2e17427ffab87aaddae6f96f6d3e76bfc2
BLAKE2b-256 checksum
How to use checksums
9d19d7a9c7742ae02ae78a6315596632a21a38658e95995ad3fc2e710f4c2f93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-bcp 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page