We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose Barcode Reader can not read bar codes consistently

We downloaded the trial barcode reader application. Some times the reader can pick up the barcode on a Bill Of Lading document, and sometimes it can not. Before we move forward with purchasing the product we need to see if it will work. Can you tell me why.


Document Scanned_BOLTif_20160405141947.TIF fails
Document 00751820000472150_20150702154630.pdf is readable.

Thank you!


Hi Terri,

Can you please share your sample application to reproduce the issue? We were not able to reproduce the issue at our end using the latest version of Aspose.Barcode for .NET i.e. 7.8.0. It reads the barcode from TIF file correctly. Following code was used to read barcodes from the TIF file.

using (BarCodeReader reader = new BarCodeReader("Scanned_BOLTif_20160405141947.TIF", DecodeType.AllSupportedTypes))

{

<?xml:namespace prefix = "o" ns = "urn:schemas-microsoft-com:office:office" />

try

{

int found = 0;

while (reader.Read() == true)

{

found++;

Console.WriteLine("BarcodeType = {0}, BarcodeValue = {1}", reader.GetCodeType().ToString(), reader.GetCodeText());

}

Console.WriteLine("Found {0} barcodes\r\n", found);

}

finally

{

reader.Close();

}

}

You can also try the following options if it works at your end.

reader.RecognitionMode = RecognitionMode.MaxBarCodes;

reader.ManualHints = ManualHint.MedianSmoothing;

Best Regards,

If I run the following code on the TIF file ending in 32912 (see new attachment), the following code does NOT find any bar codes:


namespace ScanNG
{
class Program
{
static void Main(string[] args)
{
//string fileName = @"C:\ScanTest\Scanned_BOLTif_20160324095028.TIF";
string fileName = @"C:\ScanTest\Scanned_BOLTif_20160330132912.TIF";
// string fileName = @"C:\ScanTest\Scanned_BOLTif_20160309160002.TIF";
Aspose.BarCode.License license = new Aspose.BarCode.License();
license.SetLicense("Aspose.BarCode.lic");


using (BarCodeReader reader = new BarCodeReader(fileName, DecodeType.Code39Standard))
{
reader.RecognitionMode = RecognitionMode.MaxBarCodes;
reader.ManualHints = ManualHint.MedianSmoothing;
try
{
int found = 0;
while (reader.Read() == true)
{
found++;
Console.WriteLine("BarcodeType = {0}, BarcodeValue = {1}", reader.GetCodeType().ToString(), reader.GetCodeText());
}
Console.WriteLine("Found = {0}",found);

}
finally
{
reader.Close();
}
}

If I run the following code on the attachment, two bar codes are found. One of the bar codes is a Code39Standard per the results. Why does the above code (same with the exception of the highlighted) not work:

//string fileName = @"C:\ScanTest\Scanned_BOLTif_20160324095028.TIF";
string fileName = @"C:\ScanTest\Scanned_BOLTif_20160330132912.TIF";
// string fileName = @"C:\ScanTest\Scanned_BOLTif_20160309160002.TIF";
Aspose.BarCode.License license = new Aspose.BarCode.License();
license.SetLicense("Aspose.BarCode.lic");


using (BarCodeReader reader = new BarCodeReader(fileName, DecodeType.AllStandardTypes))
{
reader.RecognitionMode = RecognitionMode.MaxBarCodes;
reader.ManualHints = ManualHint.MedianSmoothing;
try
{
int found = 0;
while (reader.Read() == true)
{
found++;
Console.WriteLine("BarcodeType = {0}, BarcodeValue = {1}", reader.GetCodeType().ToString(), reader.GetCodeText());
}
Console.WriteLine("Found = {0}",found);

}
finally
{
reader.Close();
}


Hi Terri,

We were able to reproduce this issue and it has been logged into our issue tracking system as BARCODENET-36174. We will keep you updated on this issue in this thread.

Sorry for the inconvenience.

Best Regards,

Is there an update for issue BARCODENET-36174? This is affecting an application we have in production. Please advise as to when a fix might be available. Thanks!

Hi Terri,

This is to update you that the issue has been fixed. The fix is currently at QA and review stage. The fix will be available in the next release.

Thank you for the update. Can you give me an idea when the next release will be available? We have to determine if we are going to continue using Aspose or move on if we can’t get a fix soon.


Thanks!

Hi Terri,

The issue has been fixed. The fix is available in the release Aspose.BarCode for .NET 7.9.0. The release is available in the Aspose.BarCode downloads section.

Hi Terri,

This in fact is not an issue. You can use a combination of manual hints to resolve this issue even in the older version. Please check the following code for your reference.

BarCodeReader reader = null;

try

{

reader = new BarCodeReader(filename);

int found = 0;

reader.OrientationHints = RecognitionHints.Orientation.Rotate270;

reader.RecognitionMode = RecognitionMode.ManualHints;

reader.ManualHints = ManualHint.ComplexBackground | ManualHint.MedianSmoothing;

while (reader.Read() == true)

{

found++;

Console.WriteLine("BarcodeType = {0}, BarcodeValue = {1}", reader.GetCodeType().ToString(), reader.GetCodeText());

}

Console.WriteLine("Found {0} barcodes\r\n", found);

}

Best Regards,

As stated in the post above on 4/8/2016 at 9:30PM, we tried using the combinations of manual hints and it did NOT find any bar codes on the TIF file I provided.


We just downloaded the latest version and will be testing it shortly.


Hi Terri,

You were using a single manual hint in the older code. Please check the following line in this code where two manual hints are used together to read the barcodes from your TIFF.

reader.ManualHints = ManualHint.ComplexBackground | ManualHint.MedianSmoothing;

Also, OrientationHints are used in this code to rotate the image.

Best Regards,