Hi,
Hi Amy,
We are sorry for your inconvenience.
As per the exception message, it seems that the example dashboard application didn’t download the Resource files, or the downloaded file is corrupt. I have logged a ticket (SUPPORT-2876) in this regard. We will soon check and fix the example dashboard for Aspose.OCR product samples.
Please note, you have to set the Resource file in your source code before calling the OcrEngine.Process method. Moreover, each release of Aspose.OCR for .NET has a specified Resource file. In case the Resource file set in source code is not for the specified version of Aspose.OCR component then you may get similar exception.
I have created a sample application (C# Visual Studio 2010) so you could test the product functionality on your end. Latest assembly for Aspose.OCR for .NET v1.7.0 is included in the project archive along with a sample image for your reference, but you have to download the Resource file from here.
Please feel free to write back if you have more questions.
Hi Babar,
Hi Amy,
I am sorry to know that you are still facing issues.
The project I have shared in my last reply is working fine on my end. I have also tried the project/solution download by Aspose Examples Dashboard, they are working fine as well. I have no idea why you are unable to load these project. This couldn’t be due to the reason that you have multiple Visual Studio versions installed on your machine, because I have Visual Studio 2010, 2012 and 2013 at the same time.
You can create a new project of your own, all you need is the source code for performing OCR operation on an image. Please check the below provided code snippet, and change the file location paths as per your system.
C#
// Initialize OcrEngine
var ocr = new Aspose.OCR.OcrEngine();
// Configure to use Default Dictionaries
ocr.Config.UseDefaultDictionaries = true;
// Load Image by passing the image file location path
ocr.Image = Aspose.OCR.ImageStream.FromFile(imagePath);
// Add language; you can add multiple languages
ocr.Languages.AddLanguage(Aspose.OCR.Language.Load(“english”));
// OutPut file to store results; initialize the StreamWriter with file location path
TextWriter outPut = new StreamWriter(outputPath);
// Load the resource file through FileStream by passing the Resource file location path
using (ocr.Resource = new FileStream(resourcesPath, FileMode.Open))
{
try
{
// Process the whole image
if (ocr.Process())
{
// Write results to output
outPut.WriteLine(ocr.Text);
}
}
catch (Exception ex)
{
Console.WriteLine("Exception: " + ex.Message);
}
outPut.Close();
}
Please note, you have to update the file location paths for the following variables as highlighted in above code snippet,
- imagePath: Image to be loaded
- resourcesPath: Resource file
- outputPath: Output file for results.
Hope this helps a bit. Please keep us posted with you feedback.
Hi,
Hi Amy,
Just to let you know that we have fixed the issue in Aspose Examples Dashboard for the exception message mentioned in your original post. Please delete the bin & resources folder under Aspose.OCR for .NET root folder and run the Aspose Examples Dashboard to download the deleted files once again.
Alternatively, you can also rename your previously downloaded resource file (should be of size 89,913 KB) to “aspose.ocr.resources.zip” and place it in …\Aspose\Aspose.OCR for .NET\resources folder before restarting the Aspose Examples Dashboard.
Please feed us back with your results on this.
Hi again,
Sorry, I didn’t see your response before posting this message. As shared earlier, the problem in Aspose Examples Dashboard has been fixed from our end. All you have to do is to delete the following two folders, and run the Dashboard. It will detect the deleted folders/files so they will be downloaded again.
- C:\Users\acwhitfield\Documents\Aspose\Aspose.OCR for .NET\resources
- C:\Users\acwhitfield\Documents\Aspose\Aspose.OCR for .NET\bin
Please note, the problem was due to the incorrect version of resource archive. If you have already downloaded the resource file from this link, you may simply rename the file to “aspose.ocr.resources.zip” and place it in “C:\Users\acwhitfield\Documents\Aspose\Aspose.OCR for .NET\resources” folder to make the Aspose.OCR for .NET examples run fine.
Please let us know if you still find any issue or need further help.
Hi,
Hi Amy,
First of all, please accept my apology for a bit delayed response.
I have noticed the same issue on my end as well. Although the image contains a-z, A-Z, 0-9 and a few symbols, but when we read this using Aspose.OCR for .NET v1.7.0, the result contains only a-z & A-W. Rest of the text is getting missed from the recognition process.
I am currently working on this issue, and I will soon get back to you with more updates in this regard.
Hi Amy,
Just to inform you that the behaviour of Aspose.OCR for .NET component as stated here has been logged in our bug tracking system for further investigation and correction. The ticket Id for future reference is OCR-33601. We are currently looking into this matter on priority basis, and we hope to provide a fix or any workaround at earliest.
Please accept our apologies for your inconvenience.
Hi Amy,
Sorry for the confusion.
The behavior of Aspose.OCR for .NET presented here is actually the evaluation limitation of Aspose.OCR component. Aspose Examples Dashboard and the project shared by me both lacks the licensing statements that is why the resultant recognized text is incomplete as compared to the text in the sample image. If you set a valid license before making any calls to Aspose.OCR for .NET API, you will get the complete text including the numbers and punctuation.
If you want to test Aspose.OCR for .NET component in its full capacity, I would recommend you to get a 30 days trial license by following the instructions provided on below link.
http://www.aspose.com/wiki/default.aspx/Aspose.Corporate/HowToGetTemporaryLicense.html
As soon as you get the license file, you just have to add the following two lines of code in your test project in order to make your copy of the component licensed. For reference please also check the below linked technical article on this subject.
http://www.aspose.com/docs/display/ocrnet/Licensing
C#
//Initialize an instance of Aspose.OCR.License class to call SetLicense Method
Aspose.OCR.License license = new Aspose.OCR.License();
//Please specify the full path to your license file in SetLicense Method
license.SetLicense(“Aspose.Total.Product.Family.lic”);
Please let us know if you need further guidance or have any questions.
Hi Babar,
Hi Amy,
Thank you for your feedback.
It is good to know that you are up and running again. Please create separate forum threads for every individual issue that you encounter. It is the best approach as it minimizes the confusion and keeps the issue tracking very easy.
The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.