divya_agarwal
Board Regular
- Joined
- Nov 24, 2008
- Messages
- 51
Hi,
Can any body correct me to read the data from tiff image by using MODI and OCR .
Plz check the code.
Dim doc1 As MODI.Document
Dim inputFile As String
Dim strRecText As String
Dim imageCounter As Integer
inputFile = Application.GetOpenFilename
'(Title:="Please choose a file to import", _
'FileFilter:="Image Files *.tif (*.tif)")
strRecText = ""
Set doc1 = New MODI.Document
doc1.Create (inputFile)
doc1.OCR ' this will ocr all pages of a multi-page tiff file
doc1.Save ' this will save the deskewed reoriented images, and the OCR text, back to the inputFile
For imageCounter = 0 To (doc1.Images.Count - 1) ' work your way through each page of results
strRecText = strRecText & doc1.Images(imageCounter).Layout.Text ' this puts the ocr results into a string
Next
File.AppendAllText("C:\test\testmodi.txt", strRecText) ' write the OCR file out to disk
doc1.Close
doc1 = Nothing
that program is showing error in the colored line.
Regards,
Divya Agarwal
Can any body correct me to read the data from tiff image by using MODI and OCR .
Plz check the code.
Dim doc1 As MODI.Document
Dim inputFile As String
Dim strRecText As String
Dim imageCounter As Integer
inputFile = Application.GetOpenFilename
'(Title:="Please choose a file to import", _
'FileFilter:="Image Files *.tif (*.tif)")
strRecText = ""
Set doc1 = New MODI.Document
doc1.Create (inputFile)
doc1.OCR ' this will ocr all pages of a multi-page tiff file
doc1.Save ' this will save the deskewed reoriented images, and the OCR text, back to the inputFile
For imageCounter = 0 To (doc1.Images.Count - 1) ' work your way through each page of results
strRecText = strRecText & doc1.Images(imageCounter).Layout.Text ' this puts the ocr results into a string
Next
File.AppendAllText("C:\test\testmodi.txt", strRecText) ' write the OCR file out to disk
doc1.Close
doc1 = Nothing
that program is showing error in the colored line.
Regards,
Divya Agarwal