adamchainz / treepoem

Barcode rendering for Python supporting QRcode, Aztec, PDF417, I25, Code128, Code39 and many more types.
MIT License
131 stars 26 forks source link

How to get nice EAN13 and EAN14? #292

Closed moreplavec closed 3 years ago

moreplavec commented 3 years ago

I see nice examples, but each time i try to generate EAN13 or EAN14 i get something very strange. I tried to get bigger resolution and font, but no luck to get simething nice i see everywhere. Please, can you send me options you use to generate EANs?

ean13_barcode = treepoem.generate_barcode(barcode_type='ean13', data=ean13_gen, options={'guardwhitespace': True, 'includetext': True, 'textsize': '19', 'height': '3', 'width': '5'})

generates: https://ibb.co/3C2Y513

ean13_barcode = treepoem.generate_barcode(barcode_type='ean13', data=ean13_gen, options={'includetext': True, 'height': '3', 'width': '5'})

generates: https://ibb.co/y8yt8Z4

ean14_barcode = treepoem.generate_barcode(barcode_type='ean14', data=ean14_gen, options={'includetext': True, 'textsize': '13', 'height': '3', 'width': '5'})

generates: https://ibb.co/S7zC822

Any tips what to put to options to get better image? If i try bigger font, it's out of canvas, instead of writing into bars.

adamchainz commented 3 years ago

Please, can you send me options you use to generate EANs?

I don't generate EAN's. This library is a fairly thin wrapper around postscriptbarcode (aka BWIPP). I suggest you read its docs or ask questions there about options. I can't really help with making barcodes, I don't even use this library any more, just maintain it.

moreplavec commented 3 years ago

Maybe someone else knows how to use TreePoem to get EAN pictures as shown in doc.