'While executing IronOCR on Windows Server 2016 using below line of code getting error described below
Code :
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
var Result = Ocr.Read(Path.Combine(strFileFolderPath, strFileName + "." + curentDateTime + "_" + item.strCOL02 + ".png"));
objZaftDetails.Value = new System.Text.RegularExpressions.Regex("[ ]{2,}", RegexOptions.None).Replace(Result.Text, " ").Replace("|", "");
}
Error:
"InnerException":{
"Message": "An error has occurred.",
"ExceptionMessage": "The fallback logic failed in IronOcr.Extensions.oqqfzn.",
"ExceptionType": "System.AggregateException",
"StackTrace": " at IronOcr.Extensions.oqqfzn.get_muakdj() at IronOcr.Extensions.oqqfzn.xphtgm(Int32 dvu, Int32 dvv, Int32 dvw) at IronOcr.Extensions.oqqgab.Create(Int32 width, Int32 height, Int32 depth) at IronOcr.Extensions.oqqgaa.xqiwis(Bitmap guw) at IronOcr.OcrInput.tmfvpw(Bitmap cv) at IronOcr.OcrInput.tmfvpv(Object ct, Nullable1 cu) at IronOcr.OcrInput.tmfvpv(Object ct, Nullable1 cu)",
"InnerException":{
"Message": "An error has occurred.",
"ExceptionMessage": "Could not initialize IronOcr.Extensions.oqqfzn native library.",
"ExceptionType": "IronOcr.Extensions.oqqfzo",
"StackTrace": " at IronOcr.Extensions.oqqfzn.xphtgc() at IronOcr.Extensions.oqqfzn.xphtga()",
"InnerException": {
"Message": "An error has occurred.",
"ExceptionMessage": "Could not find or load the native library from any name: [ leptonica-1.78.0.dll, liblept, liblept.dll ]",
"ExceptionType": "System.DllNotFoundException",
"StackTrace": " at NativeLibraryLoader.WindowsNativeLibraryResolver.GetLibrary(String libraryName, IEnumerable1 LibraryNames, Boolean WindowsUsesMSVCBuild, IEnumerable1 Paths) at IronOcr.Extensions.oqqfzn.xphtgc()",
"InnerException": {
"Message": "An error has occurred.",
"ExceptionMessage": "One or more errors occurred.",
"ExceptionType": "System.AggregateException",
"StackTrace": null,
"InnerException": {
"Message": "An error has occurred.",
"ExceptionMessage": "Error while loading 'leptonica-1.78.0.dll' (5): ",
"ExceptionType": "System.Exception",
"StackTrace": " at NativeLibraryLoader.LibraryLoader.LoadNativeLibrary(String name, PathResolver pathResolver) at NativeLibraryLoader.LibraryLoader.LoadNativeLibrary(String[] names, PathResolver pathResolver)"
}
}
}
}
}
Note: 2015-2022 of Microsoft Visual C++ Redistributable (x86 and x64) is installed on the Server.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
