Pisa and the last page

Hello,

I use PISA to create a good PDF file of my web pages. In any case, I would need to set the div footer - only on the last page of the document in pdf format. I found the tag "@page lastPage" in the official documentation, but I cannot get it to work. I will show you the code:

<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> 

and 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> ... 

Can you help me?

+1
source share
1 answer

You probably found a workaround, but I came across this on the pisa mailing list :

 <pdf:nextpage template='lastPage' /> 

This is not clear from the documentation, but I think that to use a different page layout, you need to manually specify the gap.

+1
source

Source: https://habr.com/ru/post/1392135/


All Articles