0

我正在使用 TuesPechkin 将 HTML 转换为 PDF,并且我正在指定一个 HTML 文件的 URL,该 URL 应该在每个页面上显示为页脚,但它不会呈现页脚。作为测试,我什至尝试将 LeftText 设置为某些东西,但它也不会呈现。

我的代码如下:

Dim FooterURL As String = "http://localhost:60699/testfooter.html"



                Dim globalSettings As New TuesPechkin.GlobalSettings With {.PaperSize = PaperKind.A4,
                                                                            .DocumentTitle = DocTitle,
                                                                           .Margins = New TuesPechkin.MarginSettings With {.Unit = TuesPechkin.Unit.Millimeters, .Bottom = 20, .Left = 20, .Right = 20, .Top = 20},
                                                                           .Copies = 1,
                                                                           .ImageQuality = 100,
                                                                           .ImageDPI = 300,
                                                                           .ProduceOutline = True,
                                                                           .PageOffset = 0,
                                                                           .DPI = 1200,
                                                                           .Orientation = TuesPechkin.GlobalSettings.PaperOrientation.Portrait}

                Dim pdfdoc As New TuesPechkin.HtmlToPdfDocument
                pdfdoc.Objects.Add(New TuesPechkin.ObjectSettings With {.HtmlText = strHTML,
                                                                        .FooterSettings = New TuesPechkin.FooterSettings With {.HtmlUrl = FooterURL, .LeftText = "blah blah blah"},
                                                                        .WebSettings = New TuesPechkin.WebSettings With {.LoadImages = True,
                                                                        .PrintBackground = True,
                                                                        .EnableJavascript = False}
                                                                       })
                Dim convertor As TuesPechkin.IPechkin = TuesPechkin.Factory.Create
                Dim buf As Byte() = convertor.Convert(strHTML)
                Return buf
4

1 回答 1

2

此问题已在 1.1.0 版本中修复,尚未发布。

https://github.com/tuespetre/TuesPechkin/issues/46

您可以从 GitHub 拉取源代码并自己构建当前代码来解决您的问题。

编辑:现在应该修复,从 2.0.0 版开始。

https://github.com/tuespetre/TuesPechkin/releases

于 2014-11-04T03:06:38.007 回答