[reportlab-users] Code 11 barcode bug
Robin Becker
robin at reportlab.com
Mon Mar 1 06:30:34 EST 2010
On 28/02/2010 22:18, Sergiu Iordache wrote:
> Hello,
>
> After trying to use the Code 11 barcode drawing function I am pretty
> sure that it is bugged. It doesn't seem to generate the correct
> barcode, but I haven't found the bug origin or solution yet. If I do,
> I'll post the solution here.
>
> Here[1] is the example code to generate a Code 11 barcode for the
> number 1 . It generates this barcode[2].
> The result is not correct, as the last character does not correspond
> to the first one and does not have enough characters. Here is the same
> number generated using an online generator [3]
>
> If anyone figures out the solution please post it here. The bug is
> most probably located here[4].
>
> Thanks a lot,
> Sergiu
........
OK I think I found two problems here.
First off my googling reveals this
http://www.mecsw.com/specs/code_11.html
that seems to indicate that both checksums should be mod 11 and not as in the
current code mod 11 & mod 10. Secondly I checked and the decompose step was
wrongly calculating the intermediate characters.
I think the attached is an improvement. Can you test it and report if it's
better for you? I don't have a reader which works with code11 so it would be
valuable if you can check if the second check digit is being correctly computed.
--
Robin Becker
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: common.py
Url: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20100301/74a93eef/attachment.ksh>
More information about the reportlab-users
mailing list