1

问候,

我正在使用 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>
...

你能帮助我吗?

4

1 回答 1

1

您现在可能已经找到了解决方法,但我在比萨邮件列表中偶然发现了这个:

<pdf:nextpage template='lastPage' /> 

从文档中不清楚,但我认为为了使用不同的页面布局,您需要手动指定中断。

于 2011-06-10T15:31:26.950 回答