Footer not rendering when converting HTML to PDF

1.8k Views Asked by At

I'm using TuesPechkin to convert HTML to PDF and I'm specifying the URL of an HTML file that should appear as the footer on each page, however it doesn't render the footer. As a test, I even tried setting the LeftText to something and that doesn't render either.

My code is as below:

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
1

There are 1 best solutions below

0
On

This problem has been fixed in version 1.1.0, which has not been released yet.

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

You can pull the source from GitHub and build the current code yourself to fix your issue.

Edit: Should be fixed now, as of version 2.0.0.

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