2011-02-08 36 views
1

问候,比萨和lastPage

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

你能帮助我吗?

+0

这个问题有什么不对吗? :( – 2011-02-10 15:24:23

回答

1

你可能已经找到了解决方法现在,但我碰到这个偶然在the pisa mailing list

<pdf:nextpage template='lastPage' /> 

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

+0

我认为这是有效的,当我知道我要写最后一页时,但是如果我无法预测它,我该怎么办?(例如,对于跨越多页的表格)谢谢 – Don 2012-09-20 16:01:59