I am using the flaying saucer jay library.
I am trying to add footers to the generated pdf file.
The goal is to have the same footer on each page and different content on the last page.
html>
<head>
<style type="text/css">
@page {
size: 8.5in 11in;
margin-bottom: 1in;
@bottom-left {
content: element(footer_one);
}
@bottom-right{
content: element(footer_two);
}
@bottom-center{
content: element(footer_rights);
}
}
</style>
</head>
<body>
<div id="footer_one">
some text short text about three words, on each page
</div>
<div id="footer_two">
some text short text, like page numbers etc, on each page
</div>
<div>
Whole body content
</div>
<div id="footer_three">
some text looooooooonnnnnnnnnggggggggg text, some about ten rows. Only on last page
</div>
</body>
I have been struggling with this for about a few days, and any advice found on the net was not good enough.
I tried with
@page:last {}
or using:
@bottom-left {
content: element(footer_one, last-except);
}
@bottom-right{
content: element(footer_two, last-except);
}
but it seems that: the last pseudo selector is not working.
The best approach would be to have a completely different one footer on the last page, which would include the contents of these three footers. I can only add a footer on the last page, but I cannot disable these simple footers from previous pages.
, ?
.