【发布时间】: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