ZPL Code to create a GS1 Compliant QR Barcode

// Expert user has replied.
J James Saville 1 year 6 months ago
3893 7 2

Hi, been searching all over interwebs for information on how to create a GS1 compliant QR Code in ZPL and need some help.

I'm simply trying to create a QR Code (using the ^BQ code) that is GS1 compliant. I can successfully do this for DataMatrix and Code-128 with FNC1 codes to get the correct symbology identifiers. There is even documentation on this website on how to do this, but it omits QR codes.
Document is here: https://supportcommunity.zebra.com/s/article/Creating-GS1-Barcodes-with…
It would be great if this could also cover QR codes!

From what I've inferred from several articles that have talked around the subject, it's leaning towards ZPL does not support GS1 compliant QR Codes, but this from dated articles - so I'm hoping to get a 2022 fresh answer since this standard has been around for about 10 years. It would be nice to get a definitive answer either way or possibly a date when this might be supported if it's not.

When scanned, these codes have a ]Q3 symbology identifier. I can create one with a ]Q1 identifier just fine, but I'm making all of my applications and code GS1 compliant, so I want to get the correct symbology.

Of course, if anyone has some links to info for some ZPL that can generate GS1 QR codes, I would greatly appreciate! I'm experimenting with some code that embeds hex \x1D into the data field, but fnc1 is a little different that then group separator character so no sure this will work.

Here is a document that outlines the GS1 2D codes:
https://www.gs1.org/sites/default/files/gs1_barcodes_fact_sheet_gs1_2d_…

The 2D QR Code produces in this reference document will output this when I scan it: ]Q301095011015300031721011910AB-123
I'd like to create the same barcode in ZPL with data : "01095011015300031721011910AB-123" and have the ]Q3 symbology id instead of ]Q1.

Thanks!

Please register or login to post a reply

7 Replies

S Steven Si

The GS1 support in the QR code has been added to the Zebra Link-OS printers since the Link-OS v6.6. See the firmware release notes.

6. GS1 type QR barcodes can now be created by specifying the FNC1 code at the beginning of the data.
This is done by using >8 as the first data after the ^FD command.

 

J James Saville

thanks - I've read thru those release notes and it sounds hopeful! But I still cannot get a valid barcode:

^XA
^FO10,10
^BQN,2,4,H
^FD>810112345678901234>8110MFATA00001>813018099999>812411184174>8191EA^FS
^XZ

http://labelary.com/viewer.html?density=8&quality=grayscale&wid…

This scans as
]Q10112345678901234>8110MFATA00001>813018099999>812411184174>8191EA

It should start with a ]Q3.

Does anyone have a working example in ZPL I can paste in Labelary?

J James Saville

This article is the closest I've found. Basically, it says there is no way to encode the FNC1 via ZPL, but it's a year or two old, so hoping there might be some updates.

https://stackoverflow.com/questions/70113013/how-to-encode-fnc1-with-zp…

I was hoping to use >8 or _1 but it seems this is not supported in ZPL? There is no mention in the ZPL programming guide. But the firmware release notes seem to indicate something is changing - perhaps it's not documented yet?

J James Saville

Well, I think I've found a workaround. I've been using the Zxing C# for parts of my labelling solution. I've got some working code that produces bitmap images of GS1 QR codes and creates PNG images for web usage. If I take the image bitmap and translate it to the ZPL graphics format and send in the ZPL as an image it should work. Need to add some code to do the ZPL image conversion and should be good to go. It's not network efficient and will create larger files to send to printer, but should work in all my use cases. Not ideal, but it seems that's what most programs are doing as workaround with no direct ZPL code method. Always open to other ideas if y'all have run into this type of thing.

J James Saville

Well got some working code. Here's the ZPL output from the C# program. It creates the bitmap using ZXing (which is GS1) and then I run the bitmap thru a Zpl image translator that generates an image I can put in ZPL code and print. Seems to work great. A little extra processing, but it works and generates the correct symbology Id when printed on a zebra printer.

Here's the sample output:

<code>^XA ^FO0,0^GFA,8000,8000,32, ,:::::::::::::I0G3PFI0GFGCM0IFG0G3GFI0LFI0GFGCH0G3PFK0:::::I0G3GFM0G3GFG0G3HFGCG0IFP0G3GFL0GFGCG0IFG0G3GFM0G3GFK0:::::I0G3GFG0G3JFG0G3GFI0JFGCH0G3GFG0G3GFJ0G3MFG0G3GFJ0G3GFG0G3JFG0G3GFK0:::::I0
G3GFG0G3JFG0G3GFG0G3HFGCG0GFGCK0G3JFG0G3GFG0G3GFL0GFGCH0G3GFG0G3JFG0G3GFK0:::::I0G3GFG0G3JFG0G3GFJ0G3GFG0G3KFGCK0G3JFJ0G3GFJ0G3GFG0G3JFG0G3GFK0:::::I0G3GFM0G3GFG0G3GFG0G3GFI0LFI0GFGCJ0GFGCG0GFGCG0IFG0G3GFM0G3GFK0:::::I0G3PFG0G3GFG0G3GFG0G3GFG0G3GFG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G3GFK0:::::O0G3GFJ0G3HFGCH0G3HFGCG0GFGCH0G3HFGCG0LFG0G3GFI0GFGCJ0GFGCG0GFGCL
0:::::I0G3KFGCG0LFG0G3GFG0G3GFG0G3HFGCS0LFI0GFGCH0G3GFG0G3GFK0:::::I0G3HFGCH0G3HFGCG0IFG0G3GFL0IFL0GFGCG0GFGCH0G3HFGCH0G3GFG0G3HFGCH0G3GFK0:::::I0G3GFG0G3GFJ0G3HFGCJ0IFL0IFG0G3GFL0GFGCG0IFG0G3JFG0G3GFG0G3GFK0:::::I0G3GFJ0G3GFM0G3HFGCH0G3NFGCG0LFG0G3GFI0GFGCJ0GFGCG0GFGCL0:
::::I0G3GFM0G3GFL0GFGCJ0IFJ0G3JFG0G3HFGCG0OFJ0G3GFK0:::::U0G3GFJ0G3MFI0LFG0G3GFJ0G3GFJ0G3HFGCH0G3GFK0:::::I0G3PFG0G3GFL0JFGCK0G3GFL0GFGCH0G3GFG0G3GFG0G3GFG0G3GFG0G3GFK0:::::I0G3GFM0G3GFI0GFGCH0G3HFGCG0MFGCH0G3JFG0G3JFJ0G3HFGCG0IFK0:::::I0G3GFG0G3JFG0G3GFG0G3HFGCH0G3GFG0G3
HFGCM0GFGCH0G3GFG0G3PFI0IFK0:::::I0G3GFG0G3JFG0G3GFG0G3JFP0G3GFI0IFG0G3GFJ0G3GFG0G3GFG0G3HFGCH0G3GFK0:::::I0G3GFG0G3JFG0G3GFG0G3HFGCG0IFI0GFGCK0G3GFL0GFGCG0GFGCG0JFGCH0G3JFK0:::::I0G3GFM0G3GFG0G3KFGCH0G3JFG0G3HFGCH0G3JFG0G3GFJ0G3JFI0IFK0:::::I0G3PFG0G3KFGCJ0IFG0G3GFI0GFGC
M0GFGCG0GFGCK0G3JFK0:::::,:::::::::::::^FS^XZ</code>

Output when scanned:
<code>]Q3019068113117692002306811311769201522072410072422375492598070593MPSAMPLE-LABEL</code>

Perfect for my use. Hope it helps someone else.

F FirstName LastName

Hi James ! 

Thanks for your help. I was having the same problem that you had, and now I´m trying to use ZXing to create the bitmap, as you explained above.

in my c# code i have 

the barcode ( gS1) I want to use is e.g.   (01)95601009001711(30)20(15)230427;

            var barcodeWriter = new BarcodeWriter();
            barcodeWriter.Format = BarcodeFormat.QR_CODE;
            barcodeWriter.Options.GS1Format = true;

            barcodeWriter.Write(barCode).Save(@"D:\generatedQrCode.bmp");

1º  how can I set the <GS> group separator 

2º how do you do the image translator so I can use the zpl code? 

Thanks !

M Michael Ward

I have a similar problem, and resorted to generating a .bmp QR code, but I cannot understand how the image data is encoded.
It cant be raw hex since there are letters other than A to F. It does not look like base64 either, although I could be wrong.

Is anyone able to shed some light on this?

CONTACT
Can’t find what you’re looking for?