zoukankan      html  css  js  c++  java
  • office ocx MSPVIEW.EXE MDIVWCTL.DLL

    c#调用office2003的文字识别功能

     bool CallOcx(string fileName, out string con)
            {
                con = "";
                try
                {
                    MODI.Document doc = new MODI.Document();
                    doc.Create(fileName);
                    doc.OCR(MODI.MiLANGUAGES.miLANG_CHINESE_SIMPLIFIED, false, false);
                    MODI.Images images = doc.Images;
                    for (int i = 0; i < images.Count; i++)
                    {
                        MODI.Image image = (MODI.Image)images[i];
                        MODI.Layout layout = image.Layout;
                        con += layout.Text + "\r\n";
                    }
                    doc.Close(false);
                    doc = null;
                    return true;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    return false;
                }
            }
     

  • 相关阅读:
    第三章例3-3
    第三章例3-2
    第二章例2-11
    第二章例2-10
    第二章例2-9
    204
    205
    202
    203
    201
  • 原文地址:https://www.cnblogs.com/baishahe/p/2143775.html
Copyright © 2011-2022 走看看