aspose.html转pdf style样式*报错,从20.4之后的版本都存在此问题,如:
* { margin: 0px auto; font-family: STSong,"Microsoft YaHei",SimHei,sans-serif; }请您尝试使用最新版本,即 .NET 21.7 的 Aspose.HTML。我们使用带有以下代码的最新版本进行了测试,没有发现任何异常或错误。 PDF 已成功生成。
string file = dataDir + "samplehtmlfile.html";
Aspose.Html.Saving.PdfSaveOptions options = new Html.Saving.PdfSaveOptions();
options.PageSetup.AnyPage.Margin = new Html.Drawing.Margin(30);
options.PageSetup.AdjustToWidestPage = true;
using (var document = new Aspose.Html.HTMLDocument(file))
{
Aspose.Html.Converters.Converter.ConvertHTML(document, options, dataDir + "htmlsupporttest.pdf");
}
test.pdf (6.8 KB)
使用您在示例应用程序中共享的新 HTML 文件,我们能够注意到 System.ArgumentException: ‘Incompatible unit types’。我们这边的例外。
并且 HTMLNET-3261 问题已记录在我们的问题跟踪系统中以进行更正。我们将调查其详细信息,并及时通知您其更正状态。请耐心等待,给我们一些时间。
我们对造成的不便很抱歉。
好的希望能尽快处理,我们现在只能用老版本20.4
The issues you have found earlier (filed as HTMLNET-3261) have been fixed in this update. This message was posted using Bugs notification tool by pavel.petrushechkin