Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

GS1 QR Code : Can i generate one via Zxing

(0) ShareShare
ReportReport
Posted on by

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);

  • Suggested answer
    Andy Sather Profile Picture
    on at
    RE: GS1 QR Code : Can i generate one via Zxing

    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.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 953

#2
YUN ZHU Profile Picture

YUN ZHU 887 Super User 2025 Season 1

#3
Mansi Soni Profile Picture

Mansi Soni 602

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans