Hello Aspose team,
Thank you for the help. My problem is solved now. :)
I have another question. I have scanned docs as images and would like to extract some texts from them.
I had already look at th examples that Aspose provides but I did not understand what this const string resourceFileName = @"2011.07.02 v1.0 Aspose.OCR.Resources.zip"; means
I wonder is this a zip file that I need to download from a place or what? Below is the example that is provided by ASPOSE
const string resourceFileName = @"2011.07.02 v1.0 Aspose.OCR.Resources.zip";
try
{
//Create an instance of OcrEngine and assign
//image, language and image settings
OcrEngine ocrEngine = new OcrEngine();
ocrEngine.Image = ImageStream.FromFile("Sample.bmp");
ocrEngine.Languages.AddLanguage(Language.Load("english"));
ocrEngine.Config.NeedRotationCorrection = false;
ocrEngine.Config.UseDefaultDictionaries = true;
//Define the block in which to recognize text
int startX = 0, startY = 0, width = 120, height = 100;
IRecognitionBlock rectangleBlock = Aspose.OCR.RecognitionBlock.FromRectangle(startX, startY, width, height);
ocrEngine.AddRecognitionBlock(rectangleBlock);
//Set the resource file name and extract OCR text
using (ocrEngine.Resource = new FileStream(resourceFileName, FileMode.Open))
{
try
{
if (ocrEngine.Process())
{
Console.WriteLine(rectangleBlock.Text.ToString());
}
}
catch (Exception ex)
{
Console.WriteLine("Exception: " + ex.Message);
}
}
ocrEngine = null;
}
catch (Exception ex)
{
Console.WriteLine("Exception: " + ex.Message);
}