I'm using flyingsaucer 9.1.1 with itext 2.17 to generate pdf files.
How can I show a footer (could be a div, a table or an img element) only on the last page but not on the other ones?
I'm using flyingsaucer 9.1.1 with itext 2.17 to generate pdf files.
How can I show a footer (could be a div, a table or an img element) only on the last page but not on the other ones?
Unfortunately, CSS defines the
page:first
pseudo element, but doesn't definepage:last
.You still have the possibility to take advantage of a bug of flying-saucer, that makes the footer only appear after it is declared. So if you put the footer
div
at the end of the HTML, it will only appear on the last page.It also works if you want a footer on each page, with a different content for the last page. You just have to define the footer
div
twice in the HTML.