If you get the error:
Leadtools.Forms.Ocr.OcrException : Engine initialization error, or there is no appropriate license.
at Leadtools.Forms.Ocr.Plus.OcrEngine.StartupEngine(String startupParameters)
at Leadtools.Forms.Ocr.Plus.OcrEngine.Startup(RasterCodecs rasterCodecs, String workDirectory, String startupParameters)
make sure the ocr engine is started with the correct path to the installation of the Leadtools.
// Start OCR-engine var ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Plus, false); if (!ocrEngine.IsStarted) { ocrEngine.Startup(null, null, @“C:\InstallationFolderLeadTools”); }
The LeadTools OCR Engine should be installed in C:\InstallationFolderLeadTools.
Adding LeadTools installation folder to the PATH variable
The error can some times be caused by the folder C:\InstallationFolderLeadTools not being in the PATH variable.
Add the [C:\InstallationFolderLeadTools] to the PATH variable.
Control Panel > System > Advanced System Settings
enable32BitAppOnWin64
This error can also be caused by an IIS or IIS express application pool not running in 32-bit application mode.
IIS
Change IIS Application Pool setting [Enable 32-bit Applications] to [True]
IIS Express
Add enable32BitAppOnWin64="true" in [C:\Users\User1\Documents\IISExpress\config\applicationhost.config].
<applicationPools>
<add name="Clr4IntegratedAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" enable32BitAppOnWin64="true">
<processModel loadUserProfile="true" />
</add>
<add name="Clr4ClassicAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Classic" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" enable32BitAppOnWin64="true"/>
<add name="Clr2IntegratedAppPool" managedRuntimeVersion="v2.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" enable32BitAppOnWin64="true"/>
<add name="Clr2ClassicAppPool" managedRuntimeVersion="v2.0" managedPipelineMode="Classic" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" enable32BitAppOnWin64="true"/>
<add name="UnmanagedClassicAppPool" managedRuntimeVersion="" managedPipelineMode="Classic" autoStart="true" enable32BitAppOnWin64="true"/>
<applicationPoolDefaults managedRuntimeLoader="v4.0">
<processModel />
</applicationPoolDefaults>
</applicationPools>