web
You’re offline. This is a read only version of the page.
close
Skip to main content
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);

I have the same question (0)
  • 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,232

#2
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 2,863

#3
Sumit Singh Profile Picture

Sumit Singh 2,819

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans