Question

I'm using WKHTMLToPDF 0.11.0_rc1 with wkhtmltopdf.tablesplit.js to generate some PDF's, the PDF have a static header and footer per page.

The raw html file is just a file with a table, with a some rows in it.

Now this is intended as invoice, and i want on the last page, bottom-aligned, a summary of the products, prices etc. How should I go by aligning it to the bottom?

When I set

 body {
    position: relative;
 }

 .summary {
    position: absolute;
    bottom: 0;
 }

It gets shown at the 1st page, in the middle.

What can I try ?

Was it helpful?

Solution

To create footers with wkhtmltopdf, you need to have them in a separate HTML file from the rest of the content with separate CSS definitions, not in the same file styled with CSS. Output your footer to a HTML file and try a command like this:

wkhtmltopdf www.google.com --footer-html myfooter.html output.pdf
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top