.net - C# nuance omnipage OCR SDK Engine.SetLicenseKey() -
im using nuance omnipage ocr sdk.
while compiling got error: engine initialization error, or no appropriate license. found should use engine.setlicensekey() method.
what file , license key should provide 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 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. 1 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; (int = 0; < 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. } { system.console.write("free resources allocated engine -- engine.forcequit\n"); engine.forcequit(); system.console.write("end of sample01 application\n"); system.console.readkey(); }
if bought software should come proper documentation and/or support how load license file , key in code. check docs or contact them.
if didn't buy software, seems requires valid license file , key. might need purchase license.
if bought software without documentation , support, consider money lost.
Comments
Post a Comment