Barcode Recognition Issue

Hello guys, Im tried to scan Barcode on your live demos and its proceeds fine. So I created account in Cloud Dashboard. I send via cloud sdk same images and it response me that barcodes not found. Do you use different solutions for live demo and cloud, or why this happens that photos which proceeds fine in live demo can’t recognise via cloud sdk?

There’s images with which I tried.
ON-Ontario-Drivers-License-–-PSD-Template-Download-2021-back-20250320-151713.jpg (277.8 KB)

ON-Ontario-Drivers-License-–-PSD-Template-Download-2021-back-20250320-151713.jpg (278 KB)
alberta Back.jpg (39.4 KB)

Hello, @sqrly

There isn’t a different solution here; rather, it’s just a preset to help clarify the requested codes. In your case, you have two barcodes: one using Code39 and another using PDF-417. Because Code39 does not include built-in checksum validation, you must add it manually in your request. After that, to scan the images you provided, you can use an example similar to the following:

static async Task RecognizePDF417andCode39Async(Aspose.BarCode.Cloud.Sdk.Api.Configuration config)
{
	var recognizeApi = new RecognizeApi(config);
	var srcFilename = Path.GetFullPath("ON-Ontario-Drivers-License-–-PSD-Template-Download-2021-back-20250320-151713.jpg");

	byte[] imageBytes = await File.ReadAllBytesAsync(srcFilename);
	string imageBase64 = Convert.ToBase64String(imageBytes);

	var request = new RecognizeBase64Request
	{
		FileBase64 = imageBase64,

		// Specify the barcode types you expect
		BarcodeTypes = [DecodeBarcodeType.Pdf417, DecodeBarcodeType.Code39],

		RecognitionMode = RecognitionMode.Fast,
		RecognitionImageKind = RecognitionImageKind.ScannedDocument,
	};

	BarcodeResponseList result = await recognizeApi.RecognizeBase64Async(request);

	foreach (var barcode in result.Barcodes)
	{
		Console.WriteLine($"{barcode.Type}: {barcode.BarcodeValue}");
	}
}

Unfortunately, the Code39 barcode on the second image (alberta Back.jpg) is too blurry to be recognized correctly. For successful scanning, please provide a higher-resolution or clearer image.

Im used Recognise Multipart type of request and it’s works bad. Now I tried it to change to Recognise Base64 and it’s works fine. Thank you!

1 Like

You are welcome!