我正在使用TuesPechkin将HTML转换为PDF,并且指定了一个HTML文件的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发布于 2014-11-04 11:06:38
此问题已在版本1.1.0中修复,该版本尚未发布。
请参阅https://github.com/tuespetre/TuesPechkin/issues/46
您可以从GitHub获取源代码,然后自己构建当前代码来解决您的问题。
Edit:现在应该是固定的,从2.0.0版本开始。
https://stackoverflow.com/questions/25658875
复制相似问题