Commit c11a1652 by 陶然

优化

parent 3687ab4d
...@@ -15,7 +15,7 @@ using System.Runtime.InteropServices; ...@@ -15,7 +15,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly:AssemblyLoadFeature(typeof(AnalyseFeature))] //[assembly:AssemblyLoadFeature(typeof(AnalyseFeature))]
// 将 ComVisible 设置为 false 会使此程序集中的类型 // 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
......
...@@ -455,8 +455,15 @@ namespace Njust.Pdf.Analysis.Tranforms ...@@ -455,8 +455,15 @@ namespace Njust.Pdf.Analysis.Tranforms
if (pdfFile == null) throw new Exception($"未找Pdf文件:{item.Title},HashCode:{item.HashCode}"); if (pdfFile == null) throw new Exception($"未找Pdf文件:{item.Title},HashCode:{item.HashCode}");
var physicalStorageFilePath = pdfFile.GetPhysicalPath(); var physicalStorageFilePath = pdfFile.GetPhysicalPath();
if (!File.Exists(physicalStorageFilePath)) throw new Exception($"未找Pdf文件:{item.Title},HashCode:{item.HashCode}"); if (!File.Exists(physicalStorageFilePath)) throw new Exception($"未找Pdf文件:{item.Title},HashCode:{item.HashCode}");
var text = Kivii.PdfBox.Instance.ReadText(physicalStorageFilePath); try
item.Allbody = text; {
var text = Kivii.PdfBox.Instance.ReadText(physicalStorageFilePath);
item.Allbody = text;
}
catch
{
item.Allbody = "暂时无法读取内容!";
}
rtns.Results.Add(item); rtns.Results.Add(item);
} }
...@@ -473,7 +480,7 @@ namespace Njust.Pdf.Analysis.Tranforms ...@@ -473,7 +480,7 @@ namespace Njust.Pdf.Analysis.Tranforms
zipFile.Save(memoryStream); zipFile.Save(memoryStream);
} }
memoryStream.Position = 0; memoryStream.Position = 0;
return new HttpResult(memoryStream, $"导出全文工{rtns.Results.Count}份文件.zip", true); return new HttpResult(memoryStream, $"导出全文工{rtns.Results.Count}份文件.zip", true);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment