6
votes

I've looked everywhere and I've only found information related to generating PDF417 codes, but nothing regarding how to decode them. Is there a library to decode them in python? I'm already detecting the code in an image and croping it, but now I need a decoder.

2
I don't think there is anything decent in python / yet but silverbaytech.com/files/pdf417/pdf_api.pdf is a good starting point and the GPL2 C code at github.com/estebandelaf/pdf417decode looks promising - jtlz2

2 Answers

4
votes

I found this little piece of code, which does just what I want. It decodes PDF417 barcodes. Doesn't seem to be that robust though, so I'll guess I'll have to give the images some strong processing to extract only the barcode.

2
votes

There are two libraries that I know of for decoding PDF417 barcodes.

You can checkout python-zxing which is a python wrapper for the ZXing decoder or you can use pdf417decoder which is a native Python port of a C# PDF417 decoder library.

ZXing requires files to be saved to the disk first while pdf417decoder can take a PIL Image object directly.