<?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[Ensure print double-sided to ensure that reports added with pdf-utils always start on a new page]]></title><description><![CDATA[<p>My client does double-sided printing, and wants each report to start on a new page. He has some reports that use pdf-utils to attach reports on append/prepend, but if a report has an odd number of pages, the next report starts on the back of the previous one.</p>
<p>I evaluated adding an empty page via a pagebreak at the end of each report, but I can't find a way to figure out what page I'm on. I also tried to do this in the headers/footers added via the util, first using $pdf.pageNum in the case of renderForEveryPage, then using the mergewholedocument strategy, but if I add a page here and not in the report on which the merge is made there is no kind of rendering.</p>
<p>How can I manage this? Any ideas or suggestions?</p>
]]></description><link>https://forum.jsreport.net/topic/912/ensure-print-double-sided-to-ensure-that-reports-added-with-pdf-utils-always-start-on-a-new-page</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 12:14:34 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/912.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 11 Feb 2019 13:38:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ensure print double-sided to ensure that reports added with pdf-utils always start on a new page on Invalid Date]]></title><description><![CDATA[<p>My client does double-sided printing, and wants each report to start on a new page. He has some reports that use pdf-utils to attach reports on append/prepend, but if a report has an odd number of pages, the next report starts on the back of the previous one.</p>
<p>I evaluated adding an empty page via a pagebreak at the end of each report, but I can't find a way to figure out what page I'm on. I also tried to do this in the headers/footers added via the util, first using $pdf.pageNum in the case of renderForEveryPage, then using the mergewholedocument strategy, but if I add a page here and not in the report on which the merge is made there is no kind of rendering.</p>
<p>How can I manage this? Any ideas or suggestions?</p>
]]></description><link>https://forum.jsreport.net/post/4402</link><guid isPermaLink="true">https://forum.jsreport.net/post/4402</guid><dc:creator><![CDATA[dfiorentin]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Ensure print double-sided to ensure that reports added with pdf-utils always start on a new page on Invalid Date]]></title><description><![CDATA[<p>So you append multiple reports using pdf utils.<br />
And if the individual inner report ends on an odd page, you need to add a page break to avoid the next report gets printed at the back of the previous one.<br />
You don't know the count of pages of individual reports in advance.<br />
Right?</p>
]]></description><link>https://forum.jsreport.net/post/4413</link><guid isPermaLink="true">https://forum.jsreport.net/post/4413</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Ensure print double-sided to ensure that reports added with pdf-utils always start on a new page on Invalid Date]]></title><description><![CDATA[<p>Correct. I could know the number of page if i'm in the header/footer, but not in the main report so i can't add the last empty page.</p>
]]></description><link>https://forum.jsreport.net/post/4415</link><guid isPermaLink="true">https://forum.jsreport.net/post/4415</guid><dc:creator><![CDATA[dfiorentin]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Ensure print double-sided to ensure that reports added with pdf-utils always start on a new page on Invalid Date]]></title><description><![CDATA[<p>I am afraid there is no solution for this at this moment. I can be wrong, but at least I don't see it so far.<br />
The problem is that you can't add a page break using merge operation.<br />
And append operation always adds at least one page.</p>
<p>There is a small chance this limited solution satisfy you. However, one option is that append operation adds one or two page breaks.<br />
This means it would work as expected for odd page numbers, but for even number of pages it would add two blank pages instead of 0.<br />
Demo here<br />
<a href="https://playground.jsreport.net/w/anon/lj4y6LRe" rel="nofollow">https://playground.jsreport.net/w/anon/lj4y6LRe</a></p>
<p>I submitted to github task which would solve such cases in general.<br />
However we will need some time to think it through so don't expect we will solve it in the next weeks.<br />
<a href="https://github.com/jsreport/jsreport/issues/490" rel="nofollow">https://github.com/jsreport/jsreport/issues/490</a></p>
<p>If you are in urgent need, you can always fork <a href="https://github.com/jsreport/jsreport-pdf-utils" rel="nofollow">jsreport-pdf-utils</a> repository and add what you need.</p>
]]></description><link>https://forum.jsreport.net/post/4416</link><guid isPermaLink="true">https://forum.jsreport.net/post/4416</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Ensure print double-sided to ensure that reports added with pdf-utils always start on a new page on Invalid Date]]></title><description><![CDATA[<p>Okay, thanks, I'll think of a solution based on your proposal until I wait for the next release. Thanks again!</p>
]]></description><link>https://forum.jsreport.net/post/4417</link><guid isPermaLink="true">https://forum.jsreport.net/post/4417</guid><dc:creator><![CDATA[dfiorentin]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Ensure print double-sided to ensure that reports added with pdf-utils always start on a new page on Wed, 13 Feb 2019 09:46:21 GMT]]></title><description><![CDATA[<p>Hi <a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/855">@dfiorentin</a> could this solve your problem : <a href="https://playground.jsreport.net/w/MI53RE/ymmZxJ0F" rel="nofollow">https://playground.jsreport.net/w/MI53RE/ymmZxJ0F</a> ?<br />
(did use <a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/2">@jan_blaha</a> solution as base) in this case we only add a blank page to documents with odd number of page without having to edit jsreport-pdf-utils directly</p>
]]></description><link>https://forum.jsreport.net/post/4427</link><guid isPermaLink="true">https://forum.jsreport.net/post/4427</guid><dc:creator><![CDATA[MI53RE19]]></dc:creator><pubDate>Wed, 13 Feb 2019 09:46:21 GMT</pubDate></item><item><title><![CDATA[Reply to Ensure print double-sided to ensure that reports added with pdf-utils always start on a new page on Invalid Date]]></title><description><![CDATA[<p>Unfortunately, no, because you're manually introducing a counter on the pages. In case the content inserted is too long (You can simulate it by inserting a very long text (such as lorem ipsum) ), you would incur in an automatic pagebreak, and your case does not handle it, while with the solution of jan_blaha yes because the control is done on the number of pages and not on a counter. Thanks anyway for the proposal.</p>
]]></description><link>https://forum.jsreport.net/post/4429</link><guid isPermaLink="true">https://forum.jsreport.net/post/4429</guid><dc:creator><![CDATA[dfiorentin]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Ensure print double-sided to ensure that reports added with pdf-utils always start on a new page on Invalid Date]]></title><description><![CDATA[<p>Indeed, I didn't realised this aspect, apologies.<br />
Here is an updated version that will be, again, based on jan_blaha way AND tested against a lorem as you suggested before getting back to you<br />
<a href="https://playground.jsreport.net/w/MI53RE/C3~M5Vyo" rel="nofollow">https://playground.jsreport.net/w/MI53RE/C3~M5Vyo</a></p>
]]></description><link>https://forum.jsreport.net/post/4432</link><guid isPermaLink="true">https://forum.jsreport.net/post/4432</guid><dc:creator><![CDATA[MI53RE19]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Ensure print double-sided to ensure that reports added with pdf-utils always start on a new page on Fri, 15 Feb 2019 10:42:10 GMT]]></title><description><![CDATA[<p>Yes, it's a good start! If I have n documents in the app you will have to add the function at the beginning of each but it is not a big problem, thank you!</p>
<p>Remaining on the subject, there are 2 other issues related to double-sided management:</p>
<ol>
<li>If I am within a cycle in a single report, how do I manage the jump page?  Let me explain: let's suppose that I have to print a section in a report several times, and I want it to always start on an even page. Not having the $pdf.pages and not being able to use counters because we do not know how long the previous page can be, how could you do?</li>
<li>In the case of headers added via pdf utils using the merge whole document option, these are also rendered over the blank pages. Is there a workaround to prevent this from happening?</li>
</ol>
]]></description><link>https://forum.jsreport.net/post/4457</link><guid isPermaLink="true">https://forum.jsreport.net/post/4457</guid><dc:creator><![CDATA[dfiorentin]]></dc:creator><pubDate>Fri, 15 Feb 2019 10:42:10 GMT</pubDate></item></channel></rss>