问候,
我正在使用 PISA 为我的网页生成一些不错的 pdf。无论如何,我需要在 pdf 文档的最后一页中放置一个页脚 div -only-。我在官方文档中找到了标签“@page lastPage”,但我无法让它工作。我给你看我的一些代码:
<style type="text/css">
@page {
size: {{ pagesize }};
margin: 1cm;
margin-bottom: 5.6cm;
margin-top: 7cm;
@frame header {
-pdf-frame-content: headerContent;
top:1cm;
margin-left: 1cm;
margin-right: 1cm;
height:6.5cm;
}
@frame middle{
-pdf-frame-content: middleContent;
top:6.5cm;
margin-left: 1cm;
margin-right: 1cm;
height:14cm;
}
}
@page lastPage{
size: {{ pagesize }};
margin: 1cm;
margin-bottom: 5.6cm;
margin-top: 7cm;
@frame header {
-pdf-frame-content: headerContent;
top:1cm;
margin-left: 1cm;
margin-right: 1cm;
height:6.5cm;
}
@frame middle{
-pdf-frame-content: middleContent;
top:6.5cm;
margin-left: 1cm;
margin-right: 1cm;
height:11cm;
}
@frame footer {
-pdf-frame-content: footerContent;
bottom: 0cm;
margin-left: 1cm;
margin-right: 1cm;
height:5.5cm;
text-align:left;
}
}
</style>
和html:
...
<div id="headerContent">my header</div>
<div id="middleContent">my content</div>
<div id="footerContent">I want this foot in the last page only</div>
...
你能帮助我吗?