Is it possible to generate a GS1 QR code using Zxing?
Is this line just enough? - barcodeWriter.Options.GS1Format := TRUE;
How do i verify if it is GS1- QR barcode? Should the brackets be eliminated during scanning?
https://github.com/micjahn/ZXing.Net
https://github.com/micjahn/ZXing.Net/releases/download/v0.16.4.0/ZXing.Net.0.16.4.0.zip
[TryFunction] GenerateBarcode(content : Text;barcodeType : Text;height : Integer;width : Integer;pureBarcode : Boolean;margin : Integer;rotateDegree : '0,90,180,270';VAR tempBlobVar : TEMPORARY Record TempBlob)
IF NOT tempBlobVar.ISTEMPORARY THEN
ERROR('tempBlobVar must be temporary');
CASE UPPERCASE(barcodeType) OF
'ITF': barcodeFormat := barcodeFormat.ITF;
'CODE_128': barcodeFormat := barcodeFormat.CODE_128;
//'UPC_A': barcodeFormat := barcodeFormat.UPC_A;
//'EAN_8': barcodeFormat := barcodeFormat.EAN_8;
'EAN_13': barcodeFormat := barcodeFormat.EAN_13;
//'CODE_39': barcodeFormat := barcodeFormat.CODE_39;
//'CODABAR': barcodeFormat := barcodeFormat.CODABAR;
//'PLESSEY': barcodeFormat := barcodeFormat.PLESSEY;
//'MSI': barcodeFormat := barcodeFormat.MSI;
'QR_CODE': barcodeFormat := barcodeFormat.QR_CODE;
//'PDF_417': barcodeFormat := barcodeFormat.PDF_417;
//'AZTEC': barcodeFormat := barcodeFormat.AZTEC;
//'DATA_MATRIX': barcodeFormat := barcodeFormat.DATA_MATRIX;
ELSE
ERROR('Unknow barcodeType: %1', barcodeType);
END;
encodingOptions := encodingOptions.EncodingOptions();
encodingOptions.Height := height;
encodingOptions.Width := width;
encodingOptions.PureBarcode := pureBarcode;
encodingOptions.Margin := margin;
barcodeWriter := barcodeWriter.BarcodeWriter();
barcodeWriter.Format := barcodeFormat;
barcodeWriter.Options := encodingOptions;
//barcodeWriter.Options.GS1Format := TRUE;
bitmap := barcodeWriter.Write(content);
IF rotateDegree > rotateDegree::"0" THEN BEGIN
CASE rotateDegree OF
rotateDegree::"90": rotateFlipType := rotateFlipType.Rotate90FlipNone;
rotateDegree::"180": rotateFlipType := rotateFlipType.Rotate180FlipNone;
rotateDegree::"270": rotateFlipType := rotateFlipType.Rotate270FlipNone;
END;
bitmap.RotateFlip(rotateFlipType);
END;
imageFormat := imageFormat.Jpeg;
tempBlobVar.Blob.CREATEOUTSTREAM(outstr);
bitmap.Save(outstr, imageFormat);
bitmap.Dispose;
LOCAL GenerateBarCode(VAR TempBlobVar : TEMPORARY Record TempBlob;VAR BarcodeTextVar : Text)
BarcodeTextVar := '(13)' FORMAT(SalesHeader."Posting Date", 0,'')
'(400)' SalesHeader."External Document No."
'(240)' "Warehouse Activity Line"."Item No."
'(241)' SalesLine."Cross-Reference No."
'(3103)' FORMAT(PartyWeightNetto,0,'')
'(3303)' FORMAT(PartyWeightGross,0,'')
'(10)' "Warehouse Activity Line"."Lot No."
'(243)' PartyNo '/' FORMAT(ProductionOrdNo);
BarcodeLib.GenerateBarcode(BarcodeTextVar,'QR_CODE', 1, 3, FALSE, 1,0, TempBlobVar);
Hello - We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist. If you need assistance with debugging or coding I would recommend discussing this on one of our communities.
dynamicsuser.net/.../developers
I will open this up to the community in case they have something to add.
Sohail Ahmed
953
YUN ZHU
887
Super User 2025 Season 1
Mansi Soni
602