【问题标题】:Sautinsoft PdfFocus exception after migration to .NET Core 2.1迁移到 .NET Core 2.1 后的 Sautinsoft PdfFocus 异常
【发布时间】:2018-11-30 20:39:33
【问题描述】:

我购买了 DLL (6.9.4.10) 的许可证,我的 *.csproj 包含以下内容:

<ItemGroup>
  <PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0"/>
  ...
  <PackageReference Include="System.IO.Packaging" Version="4.5.0"/>
  <PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0"/>
  <PackageReference Include="ZKWeb.System.Drawing" Version="4.0.0"/>
</ItemGroup>
...
<ItemGroup>
  <Reference Include="SautinSoft.PdfFocus">
    <HintPath>..\PDF Focus .Net Full (6.9.4.10)\DLLs\Net Core 2.0\SautinSoft.PdfFocus.dll</HintPath>
  </Reference>
</ItemGroup>

我正在尝试将 PDF 转换为 DOCX 文件(在 .NET 4.5 中有效)。

这是代码的相关部分:

....
SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();
f.Serial = Settings.GetAppSetting("PdfFocusSerial", "**MySerial**");
f.OpenPdf(buffer);

if (f.PageCount > 0)
{
    f.WordOptions.Format = SautinSoft.PdfFocus.CWordOptions.eWordDocument.Docx;

    var result = f.ToWord(); //f.Exception set after this
    ...
}
...

我已经检查了相同的buffer 在旧代码中被发送,但输出不同一些字节。我在f.Exception 中设置了一个异常,即:

{System.Collections.Generic.KeyNotFoundException:
The given key '0' was not present in the dictionary. ...

当我尝试打开新创建的*.docx-文件时,Word 说它已损坏。点击一些对话框后,它仍然可以打开文件。

有人有什么想法吗?

这是 .Net Core 2.1 中此库的已知错误吗? (他们的网站上只提到了 2.0)

我也尝试过在 NuGet 上发布的免费版本,结果相同。

编辑

这确实是 .NET Core 特定版本中的错误。他们在6.9.6.29 版本中修复了这个问题。

【问题讨论】:

  • 如果您还没有尝试过供应商support
  • @MarkG 是的,我做到了,他们说他们会尽快回答。还没有回应。请在不赞成票中发表任何评论,以便我可以尝试改进我的问题?
  • 我没有否决您的问题,但是您是否尝试过在 .NET Core 2.0 中使用此库?顺便说一句,在您的项目中使用 .NET Core 2.1 时,您应该使用 Microsoft.AspNetCore.App 而不是 Microsoft.AspNetCore.All。

标签: c# asp.net-core .net-core


【解决方案1】:

我叫 Dmitry,在 SautinSoft 工作。 谢谢你的问题。你说的对。 PDF Focus.Net 和 Net Core 2.1 存在一些问题 我们的开发人员试图解决这个问题。我们发现了哪里是错误(资源/字体),我希望我们能很快准备一个新版本。 我会通知你的。

【讨论】:

  • 我们已经解决了这个问题。现在 PDF Focus .Net 支持 .Net Core 2.0 - 100%
  • 这仍然没有修复。我们从 Exception 属性中得到一个 NullReferenceException。
  • @DmitryFeoktistov 您的RTF to HTML.NET 装配是否适用于UWP 项目?从here 安装 NuGet 包后,在VS2017 上的 UWP 项目上,我在代码的第一行收到以下错误:SautinSoft.RtfToHtml r = new SautinSoft.RtfToHtml(); 错误Could not load file or assembly 'System.Drawing.Common, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.。我确实引用了`using SautinSoft;
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-11-10
  • 2019-03-03
  • 1970-01-01
  • 2021-11-04
相关资源
最近更新 更多