I am trying to OCR an image in C# using MODI. I get the following error:
System.Runtime.InteropServices.COMException (0xC6C80001): Object hasn't been initialized and can't be used yet
at MODI.DocumentClass.OCR(MiLANGUAGES LangId, Boolean OCROrientImage, Boolean OCRStraightenImage)
Here is the code I use.
MODI.Document mDoc = new MODI.Document();
mDoc.Create(imageFilePath);
mDoc.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true);
MODI.Image image = (MODI.Image) mDoc.Images[0];
String imageText = image.Layout.Text;
Here is what I noticed. It runs without any problems on Windows 2003 where I developed the code. When I move all related code into another machine with Windows 2008 and attach IIS to that code that is when I get an error.
Is it possible that there are any dependencies on the server where the code was created and compiled?
Any idea what can cause the exception? Any help would we appreciated. Thanks!