How can i use pdf utils helper functions in Header and Footer?

  • Well i'm trying to send this code to a new PdfOperation with the following code in Chrome/HeaderTemplate:

    {{#each $pdf.pages}}
              {{#if index}}
                <div style="page-break-before: always;"></div>
                    <span>Page {{getPageNumber index}} of {{getTotalPages ../$pdf.pages}}</span>

    But in each Page it is rendering Page 1 of 3 Page 2 of 3 and Page 3 of 3... The next page has the same... maybe i'm sending wrong the data in the HeaderTemplate of pdf utils in .Net, do you have any example of HeaderTemplate and FooterTemplate using pdfutils with helpers in .Net ?

  • The pdf utils shouldn't be combined with native headers/footer provided through recipe HeaderTemplate/FooterTemplate.

    Here is the .net example

    However, I recommend testing the code/template the first on your local jsreport instance, outside .net.
    Then you can replicate the API call using postman or some tool like that and then try the same with .net.
    You get a better troubleshooting flow with this approach.

Log in to reply

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