Free Support Forum - aspose.com

Failure of BarCodeReader to read barcode more than once

Hello,


I’m using the BarCodeReader to identify barcodes in scanned documents. My requirement is that I need to be able to pass a number of single page tif documents and check each document individually to determine if a barcode is present. I also know that the barcode is always going to be of a particular type.

My problem is that once the BarCodeReader instance detects its first barcode, any subsequent instance of the BarCodeReader class fails to detect a barcode on a valid image.

I have created a separate test application to validate my problem and I can reproduce it 100% of the time. The source code for my test app is below and I’ve attached the tif images I’m using to test against.

Can someone please look at this urgently as this is an extremely pressing issue for us right now.

Sincerely

David

Test Code ---------------------------

class Program
{
static void Main(string[] args)
{
Aspose.BarCode.License l = new Aspose.BarCode.License();
l.SetLicense(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"" + “Aspose.Total.lic”);
Aspose.BarCodeRecognition.License li = new Aspose.BarCodeRecognition.License();
li.SetLicense(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"" + “Aspose.Total.lic”);

try
{
BarCodeReadType type = BarCodeReadType.Code128;
List filenames = new List();
filenames.Add(@“yesbarcode.tif”);
filenames.Add(@“nobarcode.tif”);
filenames.Add(@“yesbarcode.tif”);
foreach (string filename in filenames)
{
BarCodeReader reader = new BarCodeReader(filename, type);
while (reader.Read() == true)
{
Console.WriteLine(reader.GetCodeText());
}
reader.Close();
}
}
catch (Exception exception)
{
Console.WriteLine(exception);
}
}
}

Hi David,

Sorry for the inconvenience. We are looking into this issue and will get back to you soon.

Hi,

Please check the attached dll.

Thanks,

I’ve just run my test app with that new library and it appears to have solved my issue.


Thank you very much for you’re prompt response, it is greatly appreciated.

David