A PDF417 barcode decoder
pdf417decoder is a pure Python library for decoding PDF417 barcodes.
Use the package manager pip to install pdf417decoder.
pip install pdf417decoder
from PIL import Image as PIL from pdf417decoder import PDF417Decoder image = PIL.open("barcode.png") decoder = PDF417Decoder(image) if (decoder.decode() > 0): decoded = decoder.barcode_data_index_to_string(0)
This library was tested using pdf417gen to create random barcodes and blurred with OpenCV to test error correction. PyTest is used with several test images to show the libraries capability to decode barcodes in the following test cases.
- Binary data
- Multiple barcodes
- Upside down barcode
- Rotated barcode
- Error Corrections: Corrupted data due to blurred barcode
- Error Corrections: Missing data due marks concealing barcode
- Character type transitions (Upper, Lower, Mixed and Punctuation)
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This project is a derivative of code licensed under the Code Project Open License (CPOL). The Code Project Open License (CPOL) is intended to provide developers who choose to share their code with a license that protects them and provides users of their code with a clear statement regarding how the code can be used.
Source code is a port of a C# Library created and maintained by Uzi Granot. PDF417 Barcode Decoder .NET Class Library and Two Demo Apps
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for pdf417decoder-1.0.8-py3-none-any.whl