即时通讯使用nuance omnipage OCR SDK即时通讯内容OCR SDK Engine.SetLicenseKey()
问题描述:
即时通讯。即时通讯使用nuance omnipage OCR SDK即时通讯内容OCR SDK Engine.SetLicenseKey()
编译时出现错误:引擎初始化错误或没有适当的许可证。我发现可能我应该使用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”); 在这里我得到一个错误 – Nemo
@SimonPrice,添加源代码 – Nemo