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

Free Support Forum - aspose.com

OCR.Process

Hi,

I want to execute a demo example to do OCR on image file. For this i have downloaded Aspose.OCR and Resouce file for Aspose.OCR for.Net 1.0. What is the th euse of this Resource file.

While executing demo example I am getting the following exception. "ocr.process threws an exception of type Aspose.Ocr.Ocrexception.

Can you please help me…

Here is my code.

Aspose.OCR.License license = new Aspose.OCR.License();
license.SetLicense(“C:\Documents and Settings\Administrator\My Documents\Downloads\Aspose.OCR.lic”);
const string resourceFileName = “D:\Softwares\aspose installer\2011.07.02 v1.0 Aspose.OCR.Resouces.zip”;
OcrEngine ocr = new OcrEngine();
string imgfile = “D:\Picture1 002.bmp”;
ocr.Image = ImageStream.FromFile(imgfile);
ocr.Languages.AddLanguage(Language.Load(“english”));

ocr.Config.UseDefaultDictionaries=true;
using(ocr.Resource=new FileStream(resourceFileName,FileMode.Open))
{
try
{
if (ocr.Process())
{
Console.WriteLine(“Text recognized./n” + ocr.Text);

}
}
catch (Exception ex)
{
Console.WriteLine("Exception: " + ex.Message);
}
}
Console.ReadLine();


Thanks in advance

Hi
venkateswari.

Your code looks ok and it should work. Can you please share your file for analysis?

Best Regards,