Resetting the page count



  • Hi,

    I'm using chrome-pdf and jsrender with pdfutils for the header-footer to show student reports.

    Each student report can be a varying number of pages (by design) and all reports are rendered sequentially and output in the same output file (as a requirement).

    Student A has 8 pages and Student B's report currently commences on page 9. Is there a way to reset the page count so that Student B and subsequent reports always start at page 1 noting that each report can have a different number of pages.

    The json is pretty detailed but follows this format:
    {
    "Data": [
    {
    "StudentA": {etc.}
    },
    {
    "StudentB": {etc..}
    }
    ]
    }

    I'm currently using the following code to show the page number:

    function getPageNumber (pageIndex) {
    if (pageIndex == null) {
    return ''
    }

    const pageNumber = pageIndex + 1
    
    return pageNumber
    

    }

    Thanks


Log in to reply
 

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