I am using aspose.net to read text from an image and get locations of each words. But I am not getting the exact text. Aspose.net is converting text in different format.
I am also using temporary licence and my image dpi is 300.
My Code is :
string path = @“D:\WORKING\CURRECT PROJECTS\SVN PdfToHtml\PdfToHtml\PdfToHtml\Content\Upload\Images\PCWS_How_to\PCWS_How_to28”;
Aspose.OCR.License license = new Aspose.OCR.License();
license.SetLicense(@“D:\WORKING\CURRECT PROJECTS\SVN PdfToHtml\PdfToHtml\PdfToHtml\Content\Upload\Aspose.OCR.lic”);
//Initialize an instance of OcrEngine
Aspose.OCR.OcrEngine ocrEngine = new Aspose.OCR.OcrEngine();
//Set Image property by loading an image from file path
ocrEngine.Image = Aspose.OCR.ImageStream.FromFile(path);
//Run recognition process
if (ocrEngine.Process())
{
Console.WriteLine(ocrEngine.Text);
//Retrieve an array of recognized text by parts
Aspose.OCR.IRecognizedPartInfo[] text = ocrEngine.Text.PartsInfo;
//Iterate over the text parts
foreach (Aspose.OCR.IRecognizedTextPartInfo symbol in text)
{
//Display the part information
Console.WriteLine(“Symbol:” + symbol.Text);
//Get the rectangle sourronding the symbol
Rectangle box = symbol.Box;
//Display the rectangle location on the image canvas
Console.WriteLine(“Box Location:” + box.Location);
//Display the rectangle dimensions
Console.WriteLine(“Box Size:” + box.Size);
}
}