Problems with the updates (Aspose.Barcode .NET)

Hello, guys. I created this topic to aggregate the issues with codes that was working in previous versions but when some update occurred it stopped to work.


var builder = new BarCodeBuilder(“123456_B”, Symbology.GS1Code128);

builder.Margins.Set(0); //remove all marging
builder.GraphicsUnit = GraphicsUnit.Millimeter; //specify unit
builder.CodeLocation = CodeLocation.None; //hide code text

builder.AutoSize = false;

builder.CodeText = value.Insert(0, “(”).Insert(3, “)”);
builder.EnableChecksum = EnableChecksum.Yes;
builder.Resolution = new Resolution(1200.0f, 1200.0f, ResolutionMode.Customized);
builder.AlwaysShowChecksum = true;
builder.AutoSize = true;
builder.BarHeight = h;
builder.GenerateBarCodeImage();

The code above was working at the version 7.0.0 but when it updated to 8.1.0 the code stopped work

Exception: Incorrect lenght for AI 12. Expected lenght is 6, but was 7.


Hi Pedro,

Thank you for your inquiry and providing sample code snippet.

We have tried to reproduce the issue by using the code sample with Aspose.BarCode 8.1.0 at our end. We are unable to reproduce the issue. It is therefore requested to share a complete sample project the produces the error. We will evaluate it and will update you about our findings via this forum thread.

Hi, Ikram ul Haq


Thank you for your quick response.

Reading the Release Notes, I think that I discovered the main point of the issue.

At Aspose.BarCode for .NET 7.5.0 Release Notes there is a enhancements: BARCODENET-34294 AI Codes Not Accepting Valid Values for GS1Code128.

As shown on previews post the input was 123456_B, I guess that is a invalid input for <span style=“color: rgb(51, 51, 51); font-family: “Courier New”; font-size: small; line-height: 17.3333px; background-color: rgb(255, 255, 255);”>GS1Code128<span style=“color: rgb(51, 51, 51); line-height: 17.3333px; font-family: “Courier New”; font-size: small; background-color: rgb(255, 255, 255);”>, but in previews version of Aspose.Barcode the validation was not working properly. I tested with a valid input 00001234560000000018 now it is working for me.

I appreciate if you can confirm that point.

Hi Pedro,

Thank you for writing us back.

We have investigated the matter and it was found that text “0123456_B” is an invalid input for “GS1Code128”. Furthermore old versions of Aspose.BarCode validated data incorrectly. Now the issue has been fixed under ticket BARCODENET-34294.