<?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[Pass parameters to the PDF&#x27;s header&#x2F;footer]]></title><description><![CDATA[<p>Can I pass a parameter from the PDF template to the header/footer?</p>
<p>Thanks for any advice!</p>
]]></description><link>https://forum.jsreport.net/topic/172/pass-parameters-to-the-pdf-s-header-footer</link><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Mar 2026 03:54:58 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/172.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 05 Jul 2017 21:07:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Pass parameters to the PDF&#x27;s header&#x2F;footer on Invalid Date]]></title><description><![CDATA[<p>Can I pass a parameter from the PDF template to the header/footer?</p>
<p>Thanks for any advice!</p>
]]></description><link>https://forum.jsreport.net/post/762</link><guid isPermaLink="true">https://forum.jsreport.net/post/762</guid><dc:creator><![CDATA[Genhan]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Pass parameters to the PDF&#x27;s header&#x2F;footer on Invalid Date]]></title><description><![CDATA[<p>i don't think that it is possible, but phantomjs's header/footer always inherit all the data present in its template, so maybe you just need to have all the data needed for your header available in the template</p>
<p>example: <a href="https://playground.jsreport.net/studio/workspace/BkjGhA9V-/8" rel="nofollow">https://playground.jsreport.net/studio/workspace/BkjGhA9V-/8</a></p>
]]></description><link>https://forum.jsreport.net/post/763</link><guid isPermaLink="true">https://forum.jsreport.net/post/763</guid><dc:creator><![CDATA[bjrmatos]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Pass parameters to the PDF&#x27;s header&#x2F;footer on Invalid Date]]></title><description><![CDATA[<p>Thanks, <a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/4">@bjrmatos</a> .</p>
<p>I was thinking about fetching a value in the current page to the header.</p>
<p>For example, if the person in the current page is &quot;Sebastian&quot;, the header displays &quot;Sebastian&quot;. If the person in the next page is &quot;Mia&quot;, the name &quot;Mia&quot; appears in the header. Each person might have multiple pages.</p>
<p>To be more specific, in <a href="https://playground.jsreport.net/studio/workspace/BkjGhA9V-/18" rel="nofollow">https://playground.jsreport.net/studio/workspace/BkjGhA9V-/18</a> , is it possible to display each person's name in the header for all the pages belonging to that person?</p>
]]></description><link>https://forum.jsreport.net/post/764</link><guid isPermaLink="true">https://forum.jsreport.net/post/764</guid><dc:creator><![CDATA[Genhan]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Pass parameters to the PDF&#x27;s header&#x2F;footer on Invalid Date]]></title><description><![CDATA[<p>i'm afraid that it is not possible, phantomjs header/footer are very limited and what you are trying to do is to pass the current handlebars context (the current <code>person</code> item in the array) to the header, but phantomjs does not a have a way that let's us know when new content will appear in a new page, and practically makes impossible for us to implement more advanced features in header/footer.</p>
<p>maybe you can try to play with this idea <a href="https://playground.jsreport.net/studio/workspace/BJEMYu3bb/34" rel="nofollow">https://playground.jsreport.net/studio/workspace/BJEMYu3bb/34</a>, it basically based on some calculations to let you know  the number of pages in the report in javascript, you can also see a <a href="https://jsreport.net/blog/phantomjs-pdf-watermark" rel="nofollow">blog post</a> that explains this approach for another case, maybe it will help you.</p>
]]></description><link>https://forum.jsreport.net/post/777</link><guid isPermaLink="true">https://forum.jsreport.net/post/777</guid><dc:creator><![CDATA[bjrmatos]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Pass parameters to the PDF&#x27;s header&#x2F;footer on Invalid Date]]></title><description><![CDATA[<p>Thanks, <a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/4">@bjrmatos</a> . I did check those ideas, but they do not work in my case since it is hard to find an accurate page size :-(</p>
]]></description><link>https://forum.jsreport.net/post/779</link><guid isPermaLink="true">https://forum.jsreport.net/post/779</guid><dc:creator><![CDATA[Genhan]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Pass parameters to the PDF&#x27;s header&#x2F;footer on Invalid Date]]></title><description><![CDATA[<p>I basically needed the same thing.  I solved it by not using external headers.  Rather, I just used one big table in my template, and used the thead section to make my header... complete with variables.  Worked great for me!  The thead section gets repeated at the top of each page... and the variable (receipt number, in my case) gets updated with each iteration of the for loop.  Using chrome-pdf.</p>
<p>&lt;style&gt;<br />
table.receipt {<br />
page-break-before: always;<br />
}<br />
&lt;/style&gt;<br />
{{for receipts}}<br />
&lt;table class=&quot;receipt&quot;&gt;<br />
&lt;thead&gt;<br />
&lt;tr&gt;<br />
&lt;th class=&quot;logo&quot;&gt;<br />
&lt;img src=&quot;{#asset logo.png @encoding=dataURI}&quot; /&gt;<br />
&lt;/th&gt;<br />
&lt;th class=&quot;bold center&quot;&gt;<br />
&lt;span class=&quot;big&quot;&gt;Receipt Manager&lt;/span&gt;&lt;br&gt;<br />
CASH RECEIPT &lt;br&gt;<br />
Receipt No: {{:receiptNumber}} {{:~receiptHeader(watermark)}}<br />
&lt;/th&gt;<br />
&lt;th class=&quot;center school&quot;&gt;<br />
{{:~root.school.name}}&lt;br&gt;<br />
{{:~root.school.address}}&lt;br&gt;<br />
{{:~root.school.city}}&lt;br&gt;<br />
{{:~root.school.phone}}<br />
&lt;/th&gt;<br />
&lt;/tr&gt;<br />
&lt;/thead&gt;<br />
&lt;tr class=&quot;receipt&quot;&gt;<br />
... all my data here ....<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
&lt;/div&gt;<br />
{{/for}}</p>
]]></description><link>https://forum.jsreport.net/post/2982</link><guid isPermaLink="true">https://forum.jsreport.net/post/2982</guid><dc:creator><![CDATA[Kelley Peart]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Pass parameters to the PDF&#x27;s header&#x2F;footer on Invalid Date]]></title><description><![CDATA[<p>Although I don't think you could have page numbers in my example.  You have to choose, one or the other (variables or page numbers).</p>
]]></description><link>https://forum.jsreport.net/post/2983</link><guid isPermaLink="true">https://forum.jsreport.net/post/2983</guid><dc:creator><![CDATA[Kelley Peart]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>