Where can I find "reference barcodes" to verify barcode library output?
Asked Answered
H

2

13

This question is not about 'best' barcode library recommendation, we use various products on different platforms, and need a simple way to verify if a given barcode is correct (according to its specification).

We have found cases where a barcode is rendered differently by different barcode libraries and free online barcode generators in the Internet. For example, a new release of a Delphi reporting library outputs non-numeric characters in Code128 as '0' or simply skips them in the text area. Before we do the migration, we want to check if these changes are caused by a broken implementation in the new library so we can report this as a bug to the author.

We mainly need Code128 and UCC/EAN-128 with A/B/C subcodes.

Online resources I checked so far are:

They show different results too, for example in support for characters like comma or plus signs, at least in the human readable text.

Hanselka answered 20/3, 2010 at 10:22 Comment(5)
There are various tools that generate barcodes for you; don't they suffice?Eichmann
We have found they generate different bar code images for the same input value and the same bar code type - and don't know which one is correct.Hanselka
Can you list some of these discrepancies you've found? I don't doubt your finding at all, but it helps to have something concrete to analyze.Edifice
Wolfram|Alpha can also generate barcodes. See wolframalpha.com/input/?i=barcode+123456789Karikaria
@Andreas you can specify code 128 directly: wolframalpha.com/input/?i=code+128+ABC123Foxglove
L
11

For Code128 there isn't a single correct answer. If you use Code128-A you can get a different result than Code128-C. By result I mean how it looks. Take "803150" as an example. In Code128-A you'll need 6 characters (+ start, checksum, stop) to represent this number. Code128-C only consists of numbers, so you can compress two digits into one character. Hence you'll need only 3 characters (+ start, checksum, stop) to represent the same number. The barcodes will look different (A being longer in this case), but if you scan them both will give the correct number.

Further, Code128 doesn't need to be just A, B or C. You can actually combine the different subsets. This is common for cases like "US123457890", where Code128-A or B is used on "US" and Code128-C is used on the remaining digits. This is sometime referred to as Code-128 Auto, or just Code-128. The result is a "compressed" barcode in terms of width. You could represent the same data with A/B but again that would give you a longer barcode.

Take two online generators:

I recommend the first one, where you can select between Auto/A/B/C. Here is an example image illustrating the differences:

alt text

On IDAutomation, Auto is default while A is default on Barcodes-Inc. Both are correct, you just need to be careful what subset you have selected when comparing output. I also recommend a barcode reader for use in development to test the output. Also, see this page for a comparision of the different subsets with ASCII values. I also find grandzebu.net useful, which has a free Code128 font you can use as well.

It sounds like your Delphi library always use Code128-C, since it's only possible to represent numbers in this subset.

Lorient answered 20/3, 2010 at 11:47 Comment(1)
IDAutomation and Barcodesinc show different results: for example, Barcodesinc does not accept a comma in Code128, while IDAutomation does. en.wikipedia.org/wiki/Code_128 says a comma is supported in Code128.Hanselka
D
0

Why not just scan them and see what comes back?

Daberath answered 20/3, 2010 at 20:6 Comment(1)
This only adds more 'variables': scanners can have different (mis-)configurations, like automatically adding/removing leading/trailing characters.Hanselka

© 2022 - 2024 — McMap. All rights reserved.