PdfCreatePageGroups shows first group name on all merged templates
-
Hi,
I created a playground workspace to try pdfCreatePagesGroup and PdfAddPageItem.
Main one is a template with{{{pdfAddPageItem title="Main one item"}}} {{{pdfCreatePagesGroup name="Main 1"}}}
and similarly for main 2.
Then I configure pdf-utils to create one pdf.
I expect that main one will show group Main 1 and main 2 pages will show Main 2.
but all documents show footer with Main 1 as group. Is this expected behavior?My playground is here:
<iframe src="https://playground.jsreport.net/w/rashmim00/MeIwRGLm?embed=1" width="100%" height="400" frameborder="0"></iframe>Any help is appreciated,
Thanks,
Rashmi
-
Thank yo for the nice description and the example in playground. That is always the most helpful.
I fixed the problem with this commit.
Could you please try it out on your local and let me know if it works for you?npm install jsreport/jsreport-pdf-utils --save
-
Thank you Jan. Yes It works.
One more request: Can Page numbers be according to Group too by that I mean that if Main 1 group has 1 page, show Page 1 of 1 instead of Page 1 of 2.
-
Hm, that doesn't seems to be consistent with how it works. We always parse the whole pdf before applying the merge.
Can't you solve this with another group? Like you always put a group at the end of the "appended" template and from this you can find out how many pages are in particular appended pdf.
-
Ok...I will give that a try. Thank you.