public void ReadTextFromImage(String ImagePath)
{
try
{
Label lb = new Label();
// // Grab Text From Image
MODI.Document ModiObj = new MODI.Document();
ModiObj.Create(ImagePath);
ModiObj.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true);
//Retrieve the text gathered from the image
MODI.Image ModiImageObj = (MODI.Image)ModiObj.Images[0];
Label1.Text = (ModiImageObj.Layout.Text);
string ss = ModiImageObj.Layout.Text;
// get the first MODI.Image object from Modi.Document's Images collection
MODI.Layout layout = ModiImageObj.Layout; // get the Layout property of the Modi.Image object
// ...
// do something with the objects gained from MODI
ModiObj.Close();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
This Code will run Proper in Local Machine While installing Microsoft Office Document Imaging.
I get this error on online
"Retrieving the COM class factory for component with CLSID {40942A6C-1520-4132-BDF8-BDC1F71F547B} failed due to the following error: 80040154".