【问题标题】:C# nuance omnipage OCR SDK Engine.SetLicenseKey() [closed]C# nuance omnipage OCR SDK Engine.SetLicenseKey() [关闭]
【发布时间】:2016-02-05 15:51:39
【问题描述】:

我正在使用细微差别的全页面 OCR SDK。

编译时出错:引擎初始化错误,或没有适当的许可证。我发现可能我应该使用 Engine.SetLicenseKey() 方法。

我应该向 Engine.SetLicenseKey() 提供什么文件和许可证密钥?

    try
    {
        List<OCR_Error> ocrErrors = new List<OCR_Error>();
        System.Console.Write("** Title: Nuance Capture Development System CSharp Sample01 Application **\n");
        System.Console.Write("Initializing the ENGine -- Engine.Init\n");
        Engine.SetLicenseKey("licenseFile.lcx", "licenseKey");
        Engine.Init("companyName", "projectName");
        if (Engine.RECERR == RECERR.API_INIT_WARN)
        {
            ocrErrors.Add(new OCR_Error()
            {
                Message = "Module initialization warning. One or more recognition modules haven't been initialized properly.",
                InnerMessage = "For more information, see Engine.ModulesInfo"
            });
            return;
        }
        string inputFileName = @"D:\3141864.pdf";
        string inputFilePath = Path.GetFullPath(inputFileName);
        string outputFilePath = inputFilePath.Replace('.', '_') + @".pdf";
        if (File.Exists(outputFilePath))
            File.Delete(outputFilePath);
        File.Create(outputFilePath);

        using (SettingCollection settings = new SettingCollection())
        {
            using (Document doc = new Document(inputFilePath))
            {
                int sourcePagesCount = doc.PageCount;
                for (int i = 0; i < sourcePagesCount; i++)
                {
                    using (Page page = new Page(inputFilePath, i, settings))
                    {
                        page.Preprocess();
                        page.Recognize();
                        using (Document oputputDocument = new Document(outputFilePath, 0, settings))
                        {
                            oputputDocument.InsertPage(page, i);
                            oputputDocument.Save(outputFilePath);
                        }
                    }
                }
            }
        }
    }
    catch (Exception e)
    {
        System.Console.Write(e.Message);//Error: License Manager error.
    }
    finally
    {
        System.Console.Write("Free all resources allocated by the Engine -- Engine.ForceQuit\n");
        Engine.ForceQuit();
        System.Console.Write("End of Sample01 application\n");
        System.Console.ReadKey();
    }

【问题讨论】:

  • 请分享您遇到错误的代码,以便我们为您提供帮助
  • @SimonPrice, Engine.Init("companyName", "projectName");在这里我得到一个错误
  • @SimonPrice,添加源代码

标签: c# .net sdk ocr


【解决方案1】:

如果您购买了此软件,则它应随附有关如何加载许可证文件和键入代码的适当文档和/或支持。查看文档或联系他们。

如果您没有购买此软件,它似乎需要有效的许可证文件和密钥。您可能需要购买许可证。

如果您在没有文档和支持的情况下购买了此软件,请考虑您的金钱损失。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-02-22
    • 2011-09-05
    • 2011-05-03
    • 1970-01-01
    • 1970-01-01
    • 2021-12-28
    • 1970-01-01
    相关资源
    最近更新 更多