I am creating a .png barcode from an alpha numerical value. I am using Python and the pyBarcode module. The problem is that, when I use code39, it adds a random digit to the end. Other barcode formats I tested seems to give the same problem.
Here is my code snippet
unique_filename = uuid.uuid4()
barcode_writer = ImageWriter()
ean = barcode.get('code39', "Testing-One-two-1-2",barcode_writer)
filename = ean.save(BARCODE_DIR +str(unique_filename))
And the created .png:
Non-OP Edit: Link to image is now broken.
Hope someone can assist me. Thanks
Looking at the source code for pyBarcode init function on line 57 the barcode.get() function calls:
return barcode(code, writer)
So it creates a barcode with the parameters code
and writer
set.
In the codex.py file on line 52, the code39 class is created with the checksum parameter True by default:
def __init__(self, code, writer=None, add_checksum=True):
And as per lnmx you have to explicitly set the checksum off if you don't want it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With