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