MODI OCR

A

asc4john

I'm using the MODI control in an Access Form with VBA. Using the
code, below, from the MSDN help file. When this runs I get an error at
miDoc.Images(0).OCR saying that "Object is not initialized and can't be
used yet" Is this code correct?

Dim miDoc As MODI.Document
Dim miLayout As MODI.Layout
Dim strLayoutInfo As String

Set miDoc = New MODI.Document
miDoc.Create "C:\document1.tif"

miDoc.Images(0).OCR

Set miLayout = miDoc.Images(0).Layout
strLayoutInfo = _
"Language: " & miLayout.Language & vbCrLf & _
"Number of characters: " & miLayout.NumChars & vbCrLf & _
"Number of fonts: " & miLayout.NumFonts & vbCrLf & _
"Number of words: " & miLayout.NumWords & vbCrLf & _
"Beginning of text: " & Left(miLayout.Text, 50) & vbCrLf & _
"First word of text: " & miLayout.Words(0).Text
MsgBox strLayoutInfo, vbInformation + vbOKOnly, _
"Layout Information"

Set miLayout = Nothing
Set miDoc = Nothing
 
A

asc4john

Re-install, it now works. Well, I don't know if I'd call it working.
The returned string of text bears no resemmblance to the scanned text.
Accuracy is below 10%, does MODI OCR actually work or do I should I be
using something else? I have little knowledge here so any suggestions
would be helpfull.
 
A

asc4john

Accidentally found how to make this work. However, there is an odd
problem. If I try to extract from a large scanned in document
everything works really well, but small documents do not. Small is
less than four or five words, a small scanned stripe. I found that the
strip is truned 90 degrees. How do I prevent this from happening?
 
A

asc4john

Finally got this thing working but I was doing some reading thru
various newsgroups I came across some confusing statements. Fristly,
The files I am trying to OCR are extracted from PDFs as BMP converted
to JPG. The PDFs are themselfs scanned DWG files, turned into PDFs.
So we have DWG->scanned->PDF->extracted->BMP->converted->JPG. I have
found that if I take these BMP files convert them, with MS Picture
Manager, to JPGs resized to 1046x768 OCR accuracy is pretty well 100%.
OCRing the BMP or BMP->TIFF gives less than 20% accuracy. On one of
the newsgroups there was a statement to the efffect that MODI only
works with MDI or TIFF files. Whats the real answer. I have had no
success OCRing the BMP files. Also is there a way to access the
functionality of MS Picture Manager thru VBA?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top