Hi to All techies,
I am experiencing a typical problem while extracting words from a TIFF file. I am using MODI object in C# and trying to xtract the words. The problem is I could see "DB05BHS10" in the image but when I read that word dynamically with the layout.words[0] its giving like "DROSSHSIO" Its like a puzzle to me and I am breaking my head to resolve this.
Can any one of you help me how to extract exact word the code that I writted as follows
=========
MODI.Document _MODIDocument = new MODI.Document();
StringBuilder str = new StringBuilder();
string filename = @"C:\ReadByOCR.tif";
MODI.Word word = null;
MODI.Image image = null;
MODI.Layout layout = null;
_MODIDocument.Create(filename);
_MODIDocument.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true);
for (int i = 0; i < _MODIDocument.Images.Count; i++)
{
image = (MODI.Image)_MODIDocument.Images[i];
layout = image.Layout;
for (int j = 0; j < layout.Words.Count; j++)
{
word = (MODI.Word)layout.Words[j];
str.Append(word.Text);
}
}
MessageBox.Show(str.ToString());
_MODIDocument.Close(false);
System.Runtime.InteropServices.Marshal.ReleaseComObject(image);
System.Runtime.InteropServices.Marshal.ReleaseComObject(layout);
System.Runtime.InteropServices.Marshal.ReleaseComObject(_MODIDocument);
===========================
Thanks
Vijay
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).