How to dynamically insert page break



  • Hi friends,

    My client want to print part of the pdf into one double sided page. My solution is to make sure this part will start with an odd page number. Because the pages before this part is unknown, I think I have to detect the page number dynamically, and insert a page break if needed like below.

    {{#if isEven $pdf.pageNumber}}
       <div class="page-break"></div>
    {{/if}}
    

    However, it looks like the $pad.pageNumber is not retrievable, any solutions?



  • $pdf property is provided only is you use pdf utils extension. https://jsreport.net/learn/pdf-utils
    It doesn't allow you to do extra modifications like a dynamic page break.
    It can be only used to merge one page to another.
    Or append/prepend another template.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.