[reportlab-users] upc-a barcodes
Steve Romanow
slestak989 at gmail.com
Wed Sep 8 11:25:59 EDT 2010
On 9/8/2010 10:43 AM, Peter wrote:
> On Wed, Sep 8, 2010 at 2:37 PM, Steve Romanow<slestak989 at gmail.com> wrote:
>>> 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 think my difficulty with this stems from storage of UPC values with the
>> check digit already computed. Even if I took off the last char, the barcode
>> was still shifted one position when using ean.py. I have moved on to
>> another task, but will revisit this in the future.
> Again, this is from memory, but isn't the check digit the trailing (right
> most) digit? On the other hand, the "extra" leading zero present in
> EAN13 barcodes is the left-most digit.
>
> I don't recall the details, but computing the check digit on demand
> is pretty easy.
>
> If you are storing 11 digit UPC numbers without the check digit, you
> would have to compute and append the missing checkdigit to get a
> full 12 digit UPC number, and add the leading zero if you wanted to
> turn this into a full 13 digit EAN number. (Or do the reverse if that
> is what you meant).
>
> Peter
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at lists2.reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
IIRC, the ean.py routine does the check digit calculation for you, even
if you already have it on there.
More information about the reportlab-users
mailing list