0

I'm having a problem making the footer show only on the last page of the PDF. What I am thinking is that I'll get the last page number and display the footer if the pagenumber == totalpages.

But I can't get the value of <pagenumber> tag and assign it to a freemarker variable because it is a tag in BFO. Is there any way I can accomplish that?

<#if pagenumber != totalPage>
  <macro id='footer'>Normal Footer</macro>
<#else>
  <macro id='footer'>last page footer</macro>
</#if>

I am a beginner at this.

halfer
  • 19,824
  • 17
  • 99
  • 186
Chadric Gotis
  • 117
  • 1
  • 13

1 Answers1

0

You just need to specify the footer to use in the last reference in the template like footer="childpagesfooter". childpagesfooter points to a macro where you have the HTML for the footer

<pbr header=""
         footer="childpagesfooter"
         header-height="0mm"
         footer-height="0mm"
         width='200mm'
         height='500mm'
         size='Letter'/>


// macro example
<macro id="childpagesfooter"><div class="ui-div-footer">My Footer</div></macro>
Coldstar
  • 1,324
  • 1
  • 12
  • 32
  • Tried that one before but the footer is getting repeated in every page, what I need is that the footer needs to be displayed ONLY at the last page. Thanks for trying to help tho. :) – Chadric Gotis Apr 12 '21 at 23:58
  • @ChadricGotis Did you find anything in this? I also need something like this. – Viks Jul 23 '21 at 06:02