<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Merge template to one pdf]]></title><description><![CDATA[<p>Hi<br />
I'm stuck trying to merge multiple PDFs from a template into one PDF.<br />
The use case is, I have one template for single device data. So one pdf for one device.<br />
A customer want to have one pdf for all devices. The structure of the data is the same, but in an array &quot;devices&quot;.<br />
So I would like to reuse the same template and I thought I could merge the pdf's with pdf-utils.<br />
Here is a simplified example: <a href="https://playground.jsreport.net/w/Fredo70/7f4aA6Iv" rel="nofollow">https://playground.jsreport.net/w/Fredo70/7f4aA6Iv</a></p>
<p>The problem is, the context passed to the &quot;sub-template&quot; is the whole context. But I would need the array element that is iterated.<br />
The result should be really the single pdf's merges together. So the total page numbers in the footer should be 1/1 on every page. See template &quot;desiredResult&quot;.</p>
<p>Is this possible? Or do I have to change my approach? With &quot;Partials&quot; or something else?<br />
Many thanks</p>
]]></description><link>https://forum.jsreport.net/topic/960/merge-template-to-one-pdf</link><generator>RSS for Node</generator><lastBuildDate>Wed, 11 Mar 2026 22:10:59 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/960.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 14 Mar 2019 18:33:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Merge template to one pdf on Invalid Date]]></title><description><![CDATA[<p>Hi<br />
I'm stuck trying to merge multiple PDFs from a template into one PDF.<br />
The use case is, I have one template for single device data. So one pdf for one device.<br />
A customer want to have one pdf for all devices. The structure of the data is the same, but in an array &quot;devices&quot;.<br />
So I would like to reuse the same template and I thought I could merge the pdf's with pdf-utils.<br />
Here is a simplified example: <a href="https://playground.jsreport.net/w/Fredo70/7f4aA6Iv" rel="nofollow">https://playground.jsreport.net/w/Fredo70/7f4aA6Iv</a></p>
<p>The problem is, the context passed to the &quot;sub-template&quot; is the whole context. But I would need the array element that is iterated.<br />
The result should be really the single pdf's merges together. So the total page numbers in the footer should be 1/1 on every page. See template &quot;desiredResult&quot;.</p>
<p>Is this possible? Or do I have to change my approach? With &quot;Partials&quot; or something else?<br />
Many thanks</p>
]]></description><link>https://forum.jsreport.net/post/4613</link><guid isPermaLink="true">https://forum.jsreport.net/post/4613</guid><dc:creator><![CDATA[Fredo70]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Merge template to one pdf on Invalid Date]]></title><description><![CDATA[<p>hi! yes it is possible, i've updated the example to produce what you want, <a href="https://playground.jsreport.net/w/bjrmatos/juJzIdXU" rel="nofollow">here is the link</a></p>
<p>the trick is the script <code>prepare-normalTemplate-for-merge</code> assigned to the <code>normalTemplate</code>, in which we detect that the template is getting devices data and then we modify the data to be single object that the <code>normalTemplate</code> expects</p>
]]></description><link>https://forum.jsreport.net/post/4614</link><guid isPermaLink="true">https://forum.jsreport.net/post/4614</guid><dc:creator><![CDATA[bjrmatos]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Merge template to one pdf on Invalid Date]]></title><description><![CDATA[<p>Wow. Great. Many many thanks !</p>
]]></description><link>https://forum.jsreport.net/post/4615</link><guid isPermaLink="true">https://forum.jsreport.net/post/4615</guid><dc:creator><![CDATA[Fredo70]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Merge template to one pdf on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/4">@bjrmatos</a>  How do you iterate over pdfs that take up more than one page? and to further that, how do you set a page x of y in the footer that keeps up properly in the mergeTemplate / all of the pages</p>
]]></description><link>https://forum.jsreport.net/post/11949</link><guid isPermaLink="true">https://forum.jsreport.net/post/11949</guid><dc:creator><![CDATA[ayseboogie]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>