First we need to enable some feature of Micro Soft Office.For this Follow below step-
1) Go to Control Panel and open Add and Remove Program.
2) After that right click on Microsoft Office and click on change.
3) Click on Add or Remove Program after that select Office Tool.
4) Click on Drop Down arrow and select Microsoft office Document Imaging option
5) select Run all from my Computer.
after that its added.
Coding Part-
First need to add some reference
1) Microsoft Office Document Imaging(MODI)
2) Get file path and call this method with file path.
.
public string getTextFromImage(string filelocation)
{
Document mdi= new Document();
mdi.Create(filelocation);
filelocation.OCR(MiLANGUAGES.miLANG_ENGLISH);
MODI.Image mdiimgage= (mdi.Images[0] as MODI.Image);
string text= mdiimgage.Layout.Text;
mdi.Close();
return text;
}
3) Its return extracted text from images.
1) Go to Control Panel and open Add and Remove Program.
2) After that right click on Microsoft Office and click on change.
3) Click on Add or Remove Program after that select Office Tool.
4) Click on Drop Down arrow and select Microsoft office Document Imaging option
5) select Run all from my Computer.
after that its added.
Coding Part-
First need to add some reference
1) Microsoft Office Document Imaging(MODI)
2) Get file path and call this method with file path.
.
public string getTextFromImage(string filelocation)
{
Document mdi= new Document();
mdi.Create(filelocation);
filelocation.OCR(MiLANGUAGES.miLANG_ENGLISH);
MODI.Image mdiimgage= (mdi.Images[0] as MODI.Image);
string text= mdiimgage.Layout.Text;
mdi.Close();
return text;
}
3) Its return extracted text from images.
No comments:
Post a Comment