How to render multiple page pdf with same template

  • I need to generate multiple page PDF with same template i have in jsreport using phantom-pdf engine.
    I saw your multiple page example that can't help me.
    please give some example for this.

  • Hi Hameed,
    please take a look at this sample template that i created. i don't know, if this satisfies your requirement.

  • @Vikram-Kamalapur Thanks , I think u didn't understand my problem. I am creating invoice with one template. For single invoice its fine and good but in case i need to download or generate consolidated invoice (more than one invoice at a time). Please Suggest some example @administrators @Vikram-Kamalapur

  • Hi, if I got it right, you want to to generate sevral separate page using one template?
    As far as I know, it is not possible, only one pdf document will be outputed at the end of the rendering.
    What you can do (as we do it ourself) is to generate all your invoices separately, then zip them so you can download them all at once (we did it using ZipArchive on a php server (this is native php))

    Hope this could help you!

  • administrators

    @Hameed-Irfan if you are trying to generate multiple invoices (in multiple pages) using just one template, you can try something like this, you just need to generate the div class="layout" in a handlebars each using the array of invoices data that you should have in your report data, just make sure that your invoice layout does not get bigger than one page

  • @MI53RE19 your guess was correct. I am using nodejs and i have a doubt how you are generating all invoice separately in a single click.

  • @Hameed-Irfan Sorry for the late, well actually we do loop over a list of documents we need to generate, so even with node js you can achieve it within a single click. It would simply go and fetch all the informations needed before proceding to the document generation at each iteration of the loop.

Log in to reply

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