GS1 QrCode, GS1 Code128 AutoEncode


We are in the process of upgrading form v15 to 20. One of the reasons is the improved GS1 barcode support. But we have some issues:

1. You cannot create GS1 QRcodes. This is because you have to insert a special mode indicator before the actual byte stream. So, unlike ie DataMatrix it is not possible to generate a GS1 QrCode bij inserting a special code in de data.

This is descibed in ISO/IEC 18004: FNC1 in first position
This Mode Indicator identifies symbols encoding data formatted according to the UCC/EAN Application Identifiers
standard. For this purpose, it is only used once in a symbol and shall always be placed immediately before the first
Mode Indicator used for efficient data encoding (Numeric, Alphanumeric, 8-bit byte or Kanji), and after any ECI or
Structured Append header...
The mode indicator is 0101 (5).

I have solved it for us with this patch in function TppQRCode.CalcQRCode
      if GS1 then		// our property	to indicate GS1 QrCode
        lDataValue[liDataCounter] := 5;  // FNC1
        liDataCounter := liDataCounter + 1;
        lDataBits[liDataCounter] := 4;
inserted direct after the Extended Character Interpretation (ECI) support.

2. The AutoEncode of Code-128 handling of FNC1 codes is not always correct. Point is that although FNC1 is in codeset C you cannot always insert it directly. If you are at an odd number of digits you first have to switch to SetA or B for the remaining digit, then insert FNC1.

Ie this barcode '(10)123(21)4567', AI 10 and 21 are both variable length so you must insert a FNC1 with #207, giving this barcode string:

'10123' + #207 + '214567'

AutoEncode give this invalid barcode

but must be

with barcode (10)1234(21)4567 it generates the correct

Max Paay.


  • I see that some tekst is seen as html, as code its looks better
    AutoEncode give this invalid barcode
    but must be
    with barcode (10)1234(21)4567 it generates the correct
  • Hi Max,

    Thanks for the information. We are currently researching the Code-128 issues and will mark down to enhance the QRCode logic similarly to the way you did for a future release.

    I will post back here with any new updates on these issues.

    Best Regards,

    Nico Cizik
    Digital Metaphors
Sign In or Register to comment.