MODI(Microsoft Office Document Imaging) OCR 사용하기

MODI(Microsoft Office Document Imaging) 를 설치하고

OCR만 선택한다.

Here is a code sample :
In the uses clause add : ComObj, MODI_TLB units.

Drop a MiDocView object from the activeX page onto your form. Add a button and add a Tmemo

procedure TForm.Button1Click(Sender: TObject);

Var
   doc: IDocument;
   Img: IImage;
   Layout: ILayout;

begin
   doc := IDispatch(CreateOleObject('MODI.Document')) as IDocument;
   doc.create(JvFileListBox1.FileName);
   doc.OCR(miLANG_ENGLISH, true, true);
   Img := IDispatch(doc.Images[0]) as IImage;
   Layout := IDispatch(Img.Layout) as ILayout;
   Memo1.Lines.Add(Layout.Text);
   MiDocView1.Document := doc;
   doc.Close(false);
   Img := nil;
   Layout := nil;

end;

 

Author: yyjksw