1

I'm trying to add a fixed HTML footer to the bottom of the PDF generated by Pechkin. The footer should always remain at the bottom of the PDF page. I have tried CSS on the following pages but they do not seem to work, the HTML works correctly in a browser.

http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page

http://css-tricks.com/snippets/css/sticky-footer/

Is this even possible to do with Pechkin?

user3656029
  • 101
  • 1
  • 14

1 Answers1

0

To add a footer to the PDF you need to use the Tuespechkin API.

See example:

var document = new HtmlToPdfDocument
{
    GlobalSettings =
    {
        ProduceOutline = true,
        DocumentTitle = "My Website",
        PaperSize = PaperKind.A4,
        Margins =
        {
            All = 1.375,
            Unit = Unit.Centimeters
        }
    },
    Objects = {
        new ObjectSettings
        {
            HtmlText = "<h1>My Website</h1>",
            HeaderSettings = new HeaderSettings{CenterText = "I'm a header!"},
            FooterSettings = new FooterSettings{CenterText = "I'm a footer!", LeftText = "[page]"}
        }
    }
};

Note the object settings which allow you to add a footer. The footer accepts text and html.

Nic
  • 12,220
  • 20
  • 77
  • 105
  • Thanks for your answer. I was able to pass an HTML file URL as the footer using `ObjectConfig.Footer.SetHtmlContent(FilePath)` – user3656029 Feb 04 '15 at 17:44
  • I'd advice you move to TuesPechkin. :) – Nic Feb 04 '15 at 22:10
  • What are the benefits? – user3656029 Feb 05 '15 at 11:16
  • Pechkin hasnt gotten any bugfixes in a few years - https://github.com/gmanny/Pechkin/commits/master. Tuespechkin is a Pechkin fork which is actively being developed and updated - https://github.com/tuespetre/TuesPechkin/commits/develop. – Nic Feb 05 '15 at 21:35
  • Ok thanks. Can Tuespechkin determine when the content overflows to another page? In terms of PDF reports, the main document header will be different from other page headers, for example overflow pages would only have column headers. – user3656029 Feb 06 '15 at 16:49