我使用的是剝落的java庫。Footer在最後一頁,而PDF飛碟飛行
我試圖添加頁腳到我生成的pdf。
目標是在每個頁面上有相同的頁腳,在最後一頁上有不同的內容。
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);
}
}
#footer_two {position: running(footer_two); }
#footer_one {position: running(footer_one); }
#footer_three {position: running(footer_three);}
#footer_two, #footer_one, #footer_three { margin: 0 padding:0;}
#footer_three { border-top: 2px solid #3390FF;}
</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>
我與大約幾天,任何建議在網上能找到的努力還不夠好。
我與
@page:last {}
或嘗試:
@bottom-left {
content: element(footer_one, last-except);
}
@bottom-right{
content: element(footer_two, last-except);
}
但似乎:最後僞選擇器無法正常工作。
最好的方法是在最後一頁有完全不同的頁腳,其中會包含這三個頁腳的內容。 我只能在最後一頁添加頁腳,但是我無法禁用那些簡單的頁腳。
也許還有其他的方法嗎? 我將不勝感激任何幫助。
不幸的是所有的內容是動態的。我不知道最後一頁會是什麼。 – user3333010
對不起。由於沒有'page:last'選擇器,我看不到任何解決方案。 – obourgain