6

I am trying to validate GS1 Barcodes scanned with ZXing or ZBar. The GS1 General Specifications say in 7.8 that GS1 barcodes must be transmitted with a specific Symbology Identifier:

  • ]C1 = GS1-128
  • ]e0 = GS1 DataBar and GS1 Composite Symbols
  • ]d2 = GS1 DataMatrix
  • ]Q3 = GS1 QR Code

But ZXing only shows the symbol identifier for Code 128 (with or without --gs1), not for the rest. ZBar does not show the symbol identifier at all.

Is my understanding of the specification correct?

Is there anyway to extract those identifier from a barcode with ZXing or ZBar?

Do the usual handheld scanner look at those symbol identifer at all?

Terry Burton
  • 2,801
  • 1
  • 29
  • 41
tobltobs
  • 2,782
  • 1
  • 27
  • 33
  • 1
    I had the same problem (check here: http://stackoverflow.com/questions/26390302/zxing-barcode-scanner-intent-set-decodehinttype-assume-gs1). The ZXing scanner doesn't show these characters by default. But there is an option which can be set programatically. I wrote an app which does exactly that. If you have an Android device, you might want to check it => search for "GS1-128 Decoder" in google play store. – Andreas H. Nov 24 '14 at 11:02
  • 1
    @AndreasH. But the Code-128 decoder is the only one which respects the `ASSUME_GS1` intent. All other ignore this intent. BUt I would need the FNC1 for all possible GS1 carriers. – tobltobs Nov 24 '14 at 12:49
  • @tobltobs Do you mean it is not possible to get the symbology identifiers for DataBar, DataMatrix and QR codes? – Matthias Max Dec 04 '14 at 08:33
  • @Matthias Max I don't know if it is possible. But it looks like it is not possible with a standard zbar or zxing lib. – tobltobs Dec 05 '14 at 13:41
  • I encounter with the same issue, a symbology identifier ]C1 for GS1-128 is recognizable, but others (]e0, ]d2 and ]Q3) - NOT. Thus, it looks like symbology identifiers for DataBar, DataMatrix and QR codes don't exist despite the fact that GS1 Specifications document says they are included. – Ayaz Alifov Oct 08 '15 at 14:40
  • 2
    @SaQada They exist, but the libraries do not include them in their result. – tobltobs Oct 12 '15 at 15:29
  • @tobltobs Then may be you know how to check their existence? – Ayaz Alifov Oct 13 '15 at 07:56
  • @SaQada I have no solution. It should be possible to change the zxing lib, but it looked non-trivial to me, so i gave up. – tobltobs Oct 13 '15 at 14:05
  • I use the official phonegap plugin which uses the zxing lib. The iOS port of that plugin DOES support the FNC1 for data matrix without a problem. I have already tried to compare line by line where this is happening but so far without success. – Matthias Max Jan 02 '16 at 21:45
  • Same problem for me. For ZXing, there is a flag "Assume_GS1" which enables GS1 output (at least for 128 barcode), but I haven't found a way to set this flag inside the comfortable scan examples. I ended up importing all needed projects from ZXing source and set the flag inside the Code128Reader (not very nice, but it works). – RuNaWaY87 Feb 16 '17 at 10:12

1 Answers1

1

Your understanding of the specification is indeed correct. These libraries do not follow the transmission protocol required for "FNC1 in first position", i.e. GS1 mode.

The barcode symbology standards are prescriptive: The transmission of the modified AIM symbology identifier is a mandatory part of the generic ISO symbology standards, not only the GS1 application standard.

These individual standards make no attempt to describe the overall framework within which the transmission protocol operates, leaving the reader to guess at the reasons for certain decisions based on an incomplete picture. Also, for historical reasons, these standards presuppose a hypothetical situation in which a barcode reader is connected to a host over a physical, byte-mode interface.

Handheld scanners can normally be configured to emit AIM symbology identifiers (or some proprietary equivalent) as a prefix to the transmitted message and in general will strictly adhere to the prescribed transmission protocol.

However, the typical decoder developer is nowadays writing a library for a device that both hosts the end user application and includes an integrated camera, so the "wire" over which the transmission protocol is performed is nonexistent. It is understandable that developers omit essential features of the standards for which the intent isn't clear, but in so doing they create ambiguities when decoding certain types of data.

Some types of data, such a GS1 Application Identifier syntax, require an explicit activation flag that is canonically signalled by way of a modification to the AIM symbology identier. Rarely does the API of decoder libraries supply a complete replacement for the features indicated by the symbology identifier beyond identifying the generic format of the scanned barcode. For example, device APIs typically lack signalling for GS1 mode and for the ECI protocol extension.

A related issue is that decoder libraries frequently omit to send FNC1 characters in the third and subsequent character position of a barcode message as GS (ASCII value 29), making decoding of GS1 AI syntax messages impossible. Even fewer libraries transmit "%" characters in QR Code symbols in which GS1 mode is activated as GS. These implementations are simply not complaint with the symbology standards.

The maintainer of the port of ZXing to C++ (zxing-cpp) is actively working with the barcode standard setting community to ensure proper compliance with the symbology standards. So ZXing (Java) and the wrappers and bindings ecosystem should benefit from these improvement in due course.

Terry Burton
  • 2,801
  • 1
  • 29
  • 41