[reportlab-users] upc-a barcodes

Peter peter at maubp.freeserve.co.uk
Wed Sep 8 05:11:00 EDT 2010


On Tue, Sep 7, 2010 at 9:51 PM, Steve Romanow <slestak989 at gmail.com> wrote:

>

>  I understand that upc-a and its ilk are related to EAN-13, however, it does

> not seem trivial to get UPC-12 barcodes out of ean.py.

>

> Between upc-12, ucc's, and ean's it is dangerous to use the length of

> the string as an indicator as to how it should be encoded. Is this

> already sorted out in teh community and I am just behind?


It has been a while since I worked on this, but aren't 12 digit UPC-12
barcodes the same thing as a 13 digit EAN barcode with a leading
zero added?

In a sense, you *have* to look at the length to tell them apart ;)

i.e. If you have a 12-digit UPC barcode number, you can add a
leading zero and it becomes a 13-digit EAN barcode number, and
both should give identical barcode images.

Also, if you have a UPA barcode image, it is by definition also
an EAN-13 barcode image, so you can read it as either, giving
a 12 or 13 digit barcode number. Which you get is normally
handled as part of the barcode scanner configuration.

Peter


More information about the reportlab-users mailing list