none
Unabel to use MODI.Document class. RRS feed

  • Question

  • The code raising exception in this line - MODI.Document modiDocument = new MODI.Document();

    Its throwing -

     Retrieving the COM class factory for component with CLSID {40942A6C-1520-4132-BDF8-BDC1F71F547B} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). 

    Actually I'm trying to read an image to read its text and write it into a file. 

    Following is the code:

                         

     protected void Upload(object sender, EventArgs e)
            {
                string filePath = Server.MapPath("~/Uploads/" + Path.GetFileName(FileUpload1.PostedFile.FileName));
                FileUpload1.SaveAs(filePath);

                string extractText = this.ExtractTextFromImage(filePath);

                lblText.Text = extractText.Replace(Environment.NewLine, "<br />");
            }

            private string ExtractTextFromImage(string filePath)
            {
                MODI.Document modiDocument = new MODI.Document();

                modiDocument.Create(filePath);
                modiDocument.OCR(MiLANGUAGES.miLANG_ENGLISH);
                MODI.Image modiImage = (modiDocument.Images[0] as MODI.Image);
                string extractedText = modiImage.Layout.Text;
                modiDocument.Close();
                return extractedText;
            }


    Thursday, July 21, 2016 4:33 AM

Answers

All replies