Why is OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true) causing an OCR running error?

Posted by Ian Wells on Stack Overflow See other posts from Stack Overflow or by Ian Wells
Published on 2010-06-07T09:22:56Z Indexed on 2010/06/07 16:52 UTC
Read the original article Hit count: 319

Filed under:
|
|

Hi folks,

I am using MODI to read tiff images and do what I need to do with the text. Some images work fine and then other tiff images always cause the method,

OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true)

to fail. I have researched this and tried different variations such as 'false','false' in the parameter list. I have also tried SYSDEFAULT instead of English but I still get the error. Can anyone please tell me why it would fail on some tiff images and not on others?

I have done some research and found this answer:

One possible cause is MODI trying to process a file without any recognisable text. A blank document, or one which has only drawings/scribbles and is effectively blank, will cause this exception.

Obviously this is not good enough as there is no way I can have an app that decides to OCR some images and not others. I handle the exception, but the OCR object is not then initalised so I can't do what I need to do from there.

This is a bloody nightmare! Why can't the method just do it's bloody job and if the image has some unreadable pages then just ignore them? I am using Windows 7 Ultimate and Office 2007 Ultimate.

Visual Studio version is 2008 Thanks,

IW

© Stack Overflow or respective owner

Related posts about c#

Related posts about ocr