woo-j / OkapiBarcode

Open-source barcode encoding program written in Java
http://www.okapibarcode.org.uk
Apache License 2.0
328 stars 97 forks source link

Stacked Expanded Databar verify issue #74

Closed andrewwang801 closed 3 years ago

andrewwang801 commented 4 years ago

Hello, Thanks for such wonderful library. I am using this library for so long time and I've faced one issue. image I am not sure why verifier doesn't recognize this databar. Generated using this code.

DatabarExpanded databar = DatabarExpanded(); databar.setStacked(true) databar.setContent("[01]12341234123412"); and set data type to GS1 ... What is wrong or any problem in library. I am looking forward to hearing from you soon. Thanks. Warm Regards.

gredler commented 3 years ago

I don't have access to this barcode verifier, but best I can tell the issue was probably caused by one of two things:

First, the final digit is a check digit and in this example should be 3 instead of 2, so the full (correct) example value would be "[01]12341234123413".

Second, per the spec this type of barcode should have a minimum of 2 symbol characters on the last row, which in this case requires extra padding to be added. We were not previously adding this padding, but now we are.