<?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[NumberOfPages displaying null in Meta]]></title><description><![CDATA[<p>The pdf generates fine but the meta for report.Meta.NumberOfPages is returning null. Is there something else I have to do to get the number of pages once the file is generated?</p>
<pre><code>var report = await pdfService.RenderAsync(new RenderRequest
{     
     Template = new jsreport.Types.Template
     {
          Recipe = Recipe.ChromePdf,
          Engine = Engine.Handlebars,
          Name = &quot;Violation Letter&quot;
     },
     Data = data
});
</code></pre>
]]></description><link>https://forum.jsreport.net/topic/1749/numberofpages-displaying-null-in-meta</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 15:34:15 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/1749.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 02 Oct 2020 22:41:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to NumberOfPages displaying null in Meta on Invalid Date]]></title><description><![CDATA[<p>The pdf generates fine but the meta for report.Meta.NumberOfPages is returning null. Is there something else I have to do to get the number of pages once the file is generated?</p>
<pre><code>var report = await pdfService.RenderAsync(new RenderRequest
{     
     Template = new jsreport.Types.Template
     {
          Recipe = Recipe.ChromePdf,
          Engine = Engine.Handlebars,
          Name = &quot;Violation Letter&quot;
     },
     Data = data
});
</code></pre>
]]></description><link>https://forum.jsreport.net/post/7814</link><guid isPermaLink="true">https://forum.jsreport.net/post/7814</guid><dc:creator><![CDATA[TantumLabs]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to NumberOfPages displaying null in Meta on Invalid Date]]></title><description><![CDATA[<p>The <code>report.Meta.NumberOfPages</code> unfortunately doesn't work with the chrome recipe.<br />
It was working with phantomjs some long time ago, but it isn't supported now.<br />
I will remove it from the jsreport.Types.</p>
<p>The solution needs to employ the <a href="https://jsreport.net/learn/pdf-utils" rel="nofollow">pdf utils</a> now.<br />
Here is the demo<br />
<a href="https://playground.jsreport.net/w/anon/NjyiLidA" rel="nofollow">https://playground.jsreport.net/w/anon/NjyiLidA</a></p>
<p>In c# without a stored template it would be something like this:</p>
<pre><code class="language-csharp">var customReport = rs.RenderAsync(new RenderRequest()
{
    Template = new Template()
    {
        Content = &quot;Helo world&quot;,
        Engine = Engine.Handlebars,
        Recipe = Recipe.ChromePdf,
        Scripts = new List&lt;Script&gt;
    {
        new Script
        {
            Content = @&quot;const jsreport = require('jsreport-proxy')
async function afterRender(req, res) {
    let $pdf = await jsreport.pdfUtils.parse(res.content)
    res.meta.headers.numberOfPages = $pdf.pages.length
}&quot;
        }
    }
    }
}).Result;
Console.WriteLine(customReport.Meta.RawDictionary[&quot;numberofpages&quot;]);
</code></pre>
]]></description><link>https://forum.jsreport.net/post/7816</link><guid isPermaLink="true">https://forum.jsreport.net/post/7816</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to NumberOfPages displaying null in Meta on Invalid Date]]></title><description><![CDATA[<p>That worked perfectly! I had to change the last line to match the case of the meta parameter. I created a script file and imported that into the templates I needed it on.</p>
]]></description><link>https://forum.jsreport.net/post/7819</link><guid isPermaLink="true">https://forum.jsreport.net/post/7819</guid><dc:creator><![CDATA[TantumLabs]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>