Adding fixed footer to bottom of page using Pechkin

1.8k Views Asked by At

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?

1

There are 1 best solutions below

5
On

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.