tecnickcom/tc-lib-barcode

UPC-E incorrect

Arduino1987 opened this issue · 4 comments

I have generate UPC-E for 06141939 code in three different variations which is all valid, but scanner doesn't recognize it. Valid barcode should begin with two short bars, but generated has three.:

614193
image

0614193
image

06141939
image

valid barcode generated on https://barcode.tec-it.com/en/UPCE?data=04252614:
image

my code:

$svgContent = new Com\Tecnick\Barcode\Barcode()
            ->getBarcodeObj('UPCE', '614193', -8, 480, 'black')
            ->setBackgroundColor('white')
            ->getSvgCode();

same issue with old library https://github.com/tecnickcom/TCPDF
but then I have added fix from this issue to old library it generate UPCE properly for 6-digit codes.

This should be fixed on the latest version:
2f6a691

Thank you!

It's OK for 614193 now,
image

but still not correct for 0614193 and 06141939 (should be the same as for 614193).
image

The UPC-E function expect exactly 6 digits, otherwise it will assume that the code is already in UPC-A format.