5,388
社区成员
发帖
与我相关
我的任务
分享
procedure TForm.Button1Click(Sender: TObject);
Var
doc :IDocument;
Img :IImage;
Layout :ILayout;
begin
doc := IDispatch(CreateOleObject('MODI.Document')) as IDocument;
doc.create(FileName); // just put here the filename of an image
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;