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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
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; |
최신 댓글