【问题标题】:Footer not rendering when converting HTML to PDF将 HTML 转换为 PDF 时不呈现页脚
【发布时间】:2014-10-28 19:31:10
【问题描述】:

我正在使用 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

【问题讨论】:

    标签: c# .net pdf-generation pechkin tuespechkin


    【解决方案1】:

    这个问题在1.1.0版本中已经修复,还没有发布。

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

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-13
      • 2018-04-06
      • 1970-01-01
      • 2015-01-10
      • 1970-01-01
      • 2019-08-26
      • 1970-01-01
      相关资源
      最近更新 更多