Matt Eno
Matt Eno

Reputation: 697

Footer not rendering when converting HTML to PDF

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

Upvotes: 0

Views: 1944

Answers (1)

Nic
Nic

Reputation: 12855

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

Upvotes: 2

Related Questions