Spire.Barcode is a professional barcode library specially designed for .NET developers (C#, VB.NET, ASP.NET, .NET Core) and Java developers (J2SE and J2EE) to generate, read and scan 1D & 2D barcodes.

Fri Aug 05, 2022 5:03 pm

I am creating data strings for Data Matrix barcodes that are compliant with ANSI spec MH10.8.2-2016. The data string must incorporate a specific format that includes the Record Separator character (ASCII code 30 - hex 1E), the Group Separator character (ASCII code 29 - hex 1D), and the End of Transmission character (ASCII code 4 - hex 04.) However, since version 6.1.1, I discovered that if you add the Group Separator character into the data string, when Spire.Barcode generates the Data Matrix the Group Separator character encoded is instead the File Separator character (ASCII code 28 - hex 1C). Below is sample code to generate the barcode, and I've included images of the generated barcode and the hex dump of the scanned data string demonstrating how Spire.Barcode is replacing character 29 with character 28.

var rs = char.ConvertFromUtf32(30);
var gs = char.ConvertFromUtf32(29);
var eot = char.ConvertFromUtf32(4);

BarcodeSettings bs = new BarcodeSettings();
bs.X = 2;
bs.Type = BarCodeType.DataMatrix;
bs.DataMatrixSymbolShape = DataMatrixSymbolShape.Square;
bs.ShowText = false;

var dataString = "[)>" + rs + "06" + gs + "P8675309" + gs + "Q1" + rs + eot;
bs.ShowText = true;
bs.AutoResize = true;
string filename = "Test.png";

BarCodeGenerator bg = new BarCodeGenerator(bs);
bs.Data2D = dataString;
bs.Data = dataString;

Until this issue is fixed, we have reverted to version 6.1.1.



Posts: 6
Joined: Sun Mar 01, 2015 5:25 pm

Mon Aug 08, 2022 6:54 am


Thank you for your inquiry.
I reproduced your problem and posted the problem to our bug tracking system with the problem number SPIREBARCODE-220. I will let you know as soon as the issue is resolved or there is any update. Sorry for the inconvenience.

E-iceblue support team
User avatar

Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Return to Spire.BarCode