Why Data matrix some work some do not work

Hi,
I am testing a few Data Matrix barcode online. Some work d some don’t. I am not sure why some do not work?

Second, I install NuGet Aspose.BarCode and test all images and none of them work.

Here is the simple code for scan those barcode.
private void button1_Click(object sender, EventArgs e)
{
string path = textBox1.Text; // full file path include file name
using (BarCodeReader read = new BarCodeReader($“{path}”, DecodeType.DataMatrix,
DecodeType.GS1DataMatrix,DecodeType.DotCode,
DecodeType.GS1DotCode))
{
read.QualitySettings.BarcodeQuality = BarcodeQualityMode.High;
read.ReadBarCodes();
int barcodesCount = read.FoundCount;
if (barcodesCount > 0)
{
txResults.Text = $“BarCodes count:{read.FoundCount} {Environment.NewLine}”;
}
else
{
txResults.Text = “No barcode found”;
}
}
}

242G3005-03-13 - NG.png (19.3 KB)
2473120-02-02 - OK.png (18.9 KB)

@shuling1,

Which version of the API you are using? I tested your scenario/case using your both barcode images and it works fine. I am using Aspose.BarCode v24.2, please try it.

Let us know with details and samples if you still find any issue with latest version of Aspose.BarCode for .NET.

My Aspose.BarCode version is v24.2.0.0 but the code I post always fail to find, FoundCount always 0。Do you mind to check the code shall do any changes to make it works?

Currently, we are verify all the possible package to ensure it can read customer’s barcode before we purchase the package. So if you can help to see anything I shall change that will be great.

I upload more “failed” image, just wonder can you read those barcode? Many thanks,

Shuling

242G3005-03-25.png (21.3 KB)

242G3005-03-29.png (18.7 KB)

242G3005-03-32.png (18.2 KB)

242G3005-03-34.png (19.0 KB)

242G3005-03-47.png (20.4 KB)

@shuling1,

Thanks for the barcode images.

I tested your scenario/case using all your barcode images and it works absolutely fine. Please try using the following sample code in a simple .NET application.
e.g.
Sample code:

//var bmp1 = "g:\\test2\\242G3005-03-13 - NG.png";
// var bmp1 = "g:\\test2\\2473120-02-02 - OK.png"
//string path = "g:\\test2\\242G3005-03-25.png";
string path = "g:\\test2\\242G3005-03-47.png";
using (BarCodeReader read = new BarCodeReader(path, DecodeType.DataMatrix,
DecodeType.GS1DataMatrix,DecodeType.DotCode,
DecodeType.GS1DotCode))
{

read.QualitySettings = Aspose.BarCode.BarCodeRecognition.QualitySettings.HighQuality;
    
Console.WriteLine("BarCode Count: " + read.ReadBarCodes().Length);

foreach (Aspose.BarCode.BarCodeRecognition.BarCodeResult result in read.ReadBarCodes())
   {
        // Read symbology type and code text
        Console.WriteLine("Symbology Type: " + result.CodeType);
        Console.WriteLine("CodeText: " + result.CodeText);
    }
}

Try the above code in a sample console application using Aspose.BarCode for .NET v24.2 library on your end, just set/update the barcode image file path before processing the code segment. Also, see Aspose.BarCode for .NET docs for your complete reference.

Let us know if you still find any issue or confusion.

Hi Amjad:

Use the sample code it works (has return value now).

Last question,the two barcode is different but the return value is the same as the following. Is the ****shall have value but since it is evaluation version so it has been covered?

Many thanks,

Shuling

BarCode Count: 1 File: 242G3005-03-25.png

BarCodeType:DataMatrix

BarCodeText:242G3005-03****Recognized by Aspose Barcode Reader evaluation version. Only Code39Standard can be recognized without restrictions. Please buy license to use Aspose Barcode Reader without watermarks.

BarCode Count: 1 File: 242G3005-03-29.png

BarCodeType:DataMatrix

BarCodeText:242G3005-03****Recognized by Aspose Barcode Reader evaluation version. Only Code39Standard can be recognized without restrictions. Please buy license to use Aspose Barcode Reader without watermarks.

~WRD0002.jpg (357 Bytes)

image001.png (31.4 KB)

@shuling1,

Good to know that the suggested code segment works for your needs.

Yes, your understanding is correct. When you use/set a valid license in code before using any other APIs of Aspose.BarCode for .NET, you won’t have such limits and you will get complete code text and other values correctly. See the document on licensing for your reference.