Barcode Recognition not recognizing Barcodes

I’m having trouble getting the Aspose Barcode Recognition engine to actually recognize any barcodes.


I’m fairly certain the barcode on the attached document is either EAN128 or Code128 but when I search for those specific types - no barcodes are found. When I search for AllSupportedTypes, a DivideByZero exception is thrown by the Aspose Barcode Recognition engine.

I’ve attached a sample document with barcode to this post and below is my code for a quick windows forms application that uses the Aspose Barcode Recognition logic.

I’ve also tried a variety of the RecognitionHints, but to no avail. Is there something I’m missing here?

Thank you for your response.

Imports Aspose.BarCodeRecognition
Imports System.Text

Public Class Form1

Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
‘set the BarCode license
Dim license As New Aspose.BarCode.License()
license.SetLicense(“Aspose.BarCode.lic”)

‘set the BarCodeRecognition license
Dim license2 As New Aspose.BarCodeRecognition.License()
license2.SetLicense(“Aspose.BarCode.lic”)
End Sub

Private Sub btnSelectFile_Click(sender As System.Object, e As System.EventArgs) Handles btnSelectFile.Click
If OpenFileDialog1.ShowDialog() = DialogResult.OK AndAlso Not String.IsNullOrEmpty(OpenFileDialog1.FileName) Then
txtFilename.Text = OpenFileDialog1.FileName
End If
End Sub

Private Sub btnScan_Click(sender As System.Object, e As System.EventArgs) Handles btnScan.Click
Dim reader As BarCodeReader

‘target barcode is Code128 or EAN128 types of barcode
reader = New BarCodeReader(txtFilename.Text, BarCodeReadType.AllSupportedTypes)

‘reader.SetHints(RecognitionHints.ScanStrengthHints.Strong)
’ reader.SetHints(RecognitionHints.ImageBinarizationHints.Grayscale)
’ reader.SetHints(RecognitionHints.ImageBinarizationHints.HLS)
’ reader.SetHints(RecognitionHints.ImageBinarizationHints.MedianSmoothing)
’ reader.SetHints(RecognitionHints.ThresholdHints.AutoCalculateByLine)

Dim results As New StringBuilder
Do While reader.Read()
results.AppendLine("Code Text: " & reader.GetCodeText())
results.AppendLine("Symbology Type: " & reader.GetReadType().ToString())
Loop

reader.Close()
results.AppendLine(“Done”)
txtResults.Text = results.ToString()
End Sub

End Class

Hi Brad,


Thank you for bringing this to us.

I am able to replicate your said issue with latest version of Aspose.BarCode for .NET v4.5.0.1. I have logged this problem in our tracking system under ticket Id BARCODENET-33120 for correction purposes. We will keep you posted with updated on this.

Apologies for your inconvenience.
Regards,

The issues you have found earlier (filed as BARCODENET-33120) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.