Barcode not shown completely

Hi,
I want to test a trial version of aspose.Barcode.
I’m using the following code :

using Aspose.BarCode;
using Aspose.BarCode.BarCodeRecognition;

namespace BarcodeReaderExample
{
    class Program
    {
        static void Main(string[] args)
        {
            // Load the image
            string imagePath = "path_to_image";
            BarCodeReader reader = new BarCodeReader(imagePath, DecodeType.DataMatrix);
            
            foreach (var barcode in reader.ReadBarCodes())
            {
                // Display the recognition result
                Console.WriteLine($"{barcode.CodeTypeName}: {barcode.CodeText}");
            }
        }
    }
}

However, the resulting datamatrix code is truncated “DataMatrix: B02000853610200******”
Should I do something else to properly activate my trial licence or with trial licence is not possible to visualize the entire barcode value?
thank you in advannce for the clarification!

@ngtesigg27

It seems that the DataMatrix code you are trying to read is being truncated, which can happen for a few reasons. One possibility is that the recognition quality settings are not optimized for your specific barcode or image quality.

To improve the recognition of the barcode and potentially retrieve the full value, you can adjust the recognition quality settings in your code. Aspose.BarCode for .NET provides several quality presets that can be used to enhance the reading of barcodes, such as HighQuality or MaxQuality. By default, the library uses a normal quality preset, which may not be sufficient for all scenarios.

Here’s how you can modify your code to set a higher quality preset:

using Aspose.BarCode;
using Aspose.BarCode.BarCodeRecognition;

namespace BarcodeReaderExample
{
    class Program
    {
        static void Main(string[] args)
        {
            // Load the image
            string imagePath = "path_to_image";
            BarCodeReader reader = new BarCodeReader(imagePath, DecodeType.DataMatrix);
            
            // Set the quality settings to MaxQuality
            reader.QualitySettings = new QualitySettings { Preset = QualityPreset.MaxQuality };
            
            foreach (var barcode in reader.ReadBarCodes())
            {
                // Display the recognition result
                Console.WriteLine($"{barcode.CodeTypeName}: {barcode.CodeText}");
            }
        }
    }
}

By setting the QualitySettings to MaxQuality, you may improve the chances of reading the entire barcode value. If the issue persists, ensure that the image quality is sufficient and that the barcode is not damaged or obscured.

If you are still facing issues, it might be worth checking if there are any limitations with the trial version of the library regarding the length of the barcode values that can be read.

Feel free to reach out if you need further assistance!

this is the complete output, so it seams that my trial has some restrictions
Immagine1.png (28,4 KB)

@ngtesigg27,

Thanks for the screenshot.

Yes, your issue (barcode text is not retrieved completely) is due to the limitation put forth by using the trial version (i.e., using Aspose.BarCode for .NET API without a valid license). Please note, in evaluation mode (without using/setting a valid license in code), only the *Code39* symbology would be used without limitations; for all other barcode types, 30% of the decrypted text will be masked with " * ". Please see the document for your complete reference on licensing and its limitations.
https://docs.aspose.com/barcode/net/licensing/

By the way, you can request a 30-day temporary license for testing and using Aspose.BarCode API without any restriction. Please refer to How to get a Temporary License? for more information.

Let us know if we can be of any further help.