迁移到 .NET Core 2.1 后的 Sautinsoft PdfFocus 异常 [英] Sautinsoft PdfFocus exception after migration to .NET Core 2.1

查看:25
本文介绍了迁移到 .NET Core 2.1 后的 Sautinsoft PdfFocus 异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a purchased license of the DLLs (6.9.4.10) and my *.csproj contains this:

<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)DLLsNet Core 2.0SautinSoft.PdfFocus.dll</HintPath>
  </Reference>
</ItemGroup>

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

I am trying to convert a PDF into a DOCX-file (which worked in .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 中设置了一个异常,即:

I've checked that the same buffer is sent in as in the old code, but the output differs by some bytes. And I get an Exception set in f.Exception, which is:

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

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

When I try to open the newly created *.docx-file, Word says it's damaged. After clicking through some dialogs it can still open the file.

有人有什么想法吗?

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

Is this a known bug for this library in .Net Core 2.1? (Only 2.0 is mentioned on their website)

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

I've also tried the free version published on NuGet with the same results.

编辑

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

This was indeed a bug in the .NET Core specific version. They have fixed this in version 6.9.6.29.

推荐答案

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

My Name is Dmitry and I work in SautinSoft. Thank you for your issue. You are right. We have some problems with PDF Focus.Net and Net Core 2.1 Our developers try to fix this issue. We have found where is a bug (resources/fonts) and I hope, that we will prepare a new version very quickly. I'll inform you.

这篇关于迁移到 .NET Core 2.1 后的 Sautinsoft PdfFocus 异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆