0

代码 :

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("|", "");
}

错误: “InnerException”:{“Message”:“发生错误。”,
“ExceptionMessage”:“IronOcr.Extensions.oqqfzn 中的回退逻辑失败。”,
“ExceptionType”:“System.AggregateException”,
“StackTrace” :“在 IronOcr.Extensions.oqqfzn.get_muakdj() 在 IronOcr.Extensions.oqqfzn.xphtgm(Int32 dvu, Int32 dvv, Int32 dvw) 在 IronOcr.Extensions.oqqgab.Create(Int32 宽度, Int32 高度, Int32 深度) 在 IronOcr .Extensions.oqqgaa.xqiwis(Bitmap guw) at IronOcr.OcrInput.tmfvpw(Bitmap cv) at IronOcr.OcrInput.tmfvpv(Object ct, Nullable 1 cu) at IronOcr.OcrInput.tmfvpv(Object ct, Nullable1 cu)",
"InnerException":{
"Message": "发生错误.",
"异常消息": "无法初始化 IronOcr.Extensions.oqqfzn 本机库。",
"ExceptionType": "IronOcr.Extensions.oqqfzo",
“StackTrace”:“在 IronOcr.Extensions.oqqfzn.xphtgc() 在 IronOcr.Extensions.oqqfzn.xphtga()”,
“InnerException”:{
“Message”:“发生错误。”,
“ExceptionMessage”:“可能找不到或从任何名称加载本机库:[ leptonica-1.78.0.dll,liblept,liblept.dll ]”,
“ExceptionType”:“System.DllNotFoundException”,
“StackTrace”:“在 NativeLibraryLoader.WindowsNativeLibraryResolver.GetLibrary(字符串 libraryName, IEnumerable 1 LibraryNames, Boolean WindowsUsesMSVCBuild, IEnumerable1 Paths) at IronOcr.Extensions.oqqfzn.xphtgc()",
"InnerException": {
"Message": "An error has occurred.",
"ExceptionMessage": "一个或多个错误发生。",
"ExceptionType": "System.AggregateException",
"StackTrace": null,
"InnerException": {
“Message”:“发生错误。”,
“ExceptionMessage”:“加载'leptonica-1.78.0.dll'(5)时出错:”,
“ExceptionType”:“System.Exception”,
“StackTrace”:“在 NativeLibraryLoader.LibraryLoader.LoadNativeLibrary(String name, PathResolver pathResolver) 在 NativeLibraryLoader.LibraryLoader.LoadNativeLibrary(String[] names, PathResolver pathResolver)"
} } } } }

注意: 服务器上安装了 Microsoft Visual C++ Redistributable(x86 和 x64)的 2015-2022。

4

0 回答 0