<?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[Can the template detect a page break?]]></title><description><![CDATA[<p>I'm using phantom-pdf and sometimes, when the data content matches a certain scenario, I end up with a page break just before an important part of the document and, as a result, it can get a little lost at the top of the next page. If I add a load of spacing around it, that can have the result of it being pushed onto the next page when it would not have previously so I wondered if there is a way for you to pick up the page break through script or CSS to be able to provide a different style for an element that appears immediately after the page break or is this just wishful thinking?</p>
]]></description><link>https://forum.jsreport.net/topic/802/can-the-template-detect-a-page-break</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 06:26:21 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/802.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 Nov 2018 15:30:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Can the template detect a page break? on Invalid Date]]></title><description><![CDATA[<p>I'm using phantom-pdf and sometimes, when the data content matches a certain scenario, I end up with a page break just before an important part of the document and, as a result, it can get a little lost at the top of the next page. If I add a load of spacing around it, that can have the result of it being pushed onto the next page when it would not have previously so I wondered if there is a way for you to pick up the page break through script or CSS to be able to provide a different style for an element that appears immediately after the page break or is this just wishful thinking?</p>
]]></description><link>https://forum.jsreport.net/post/3918</link><guid isPermaLink="true">https://forum.jsreport.net/post/3918</guid><dc:creator><![CDATA[agiletea]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Can the template detect a page break? on Fri, 02 Nov 2018 16:57:56 GMT]]></title><description><![CDATA[<p>Personnaly I would prefere to force the page break using the following function (added in a global asset helpers) :</p>
<pre><code class="language-javascript">function newPage() {
    return '&lt;div style=&quot;display: block; page-break-before: always;&quot;&gt;&lt;/div&gt;';
}
</code></pre>
<p>then upon meeting certain condition just call it like follow</p>
<pre><code class="language-html">&lt;body&gt;
{{#each items}}
  {{#if condition}}
    {{{newPage}}}
   &lt;some-html&gt;your content&lt;/some-html&gt;
  {{/if}}
{{/each}}
&lt;/body&gt;
</code></pre>
<p>I do believe it is the easiest way you can achieve what you seek, hope this will help you!</p>
]]></description><link>https://forum.jsreport.net/post/3921</link><guid isPermaLink="true">https://forum.jsreport.net/post/3921</guid><dc:creator><![CDATA[MI53RE19]]></dc:creator><pubDate>Fri, 02 Nov 2018 16:57:56 GMT</pubDate></item><item><title><![CDATA[Reply to Can the template detect a page break? on Invalid Date]]></title><description><![CDATA[<p>Thanks for the reply!</p>
<p>I did spot the option to force a page break but it's that condition I think I need to determine that I'm struggling with. It's for a quote template and sometimes you have just a small piece of text followed by the estimate, other times it can be half an essay! I think I need to probably use the length of the quote details and work out at what length I should consider the before forcing a page break. Only I also have manipulation of the text to include line breaks so that may also be hit and miss.</p>
<p>I'll play around with it and post any ideas I come across that I think may help others.<br />
Thanks again for the suggestion - it's helped narrow the path :)</p>
<p>Best Regards</p>
]]></description><link>https://forum.jsreport.net/post/3922</link><guid isPermaLink="true">https://forum.jsreport.net/post/3922</guid><dc:creator><![CDATA[agiletea]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>