<?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[White bar in header and footer]]></title><description><![CDATA[<p>Hey,</p>
<p>I'm trying to create a pdf with a header/footer image flush with the page. I've managed to get an image rendering using a base64 image but on both the header and footer there is a small white bar that I cannot figure out how to get rid of.</p>
<p><img src="/uploads/files/1639047343728-upload-c9c8f331-76b7-4c31-8925-ebd82c4f82ef-resized.png" alt="0_1639047341976_upload-c9c8f331-76b7-4c31-8925-ebd82c4f82ef" class="img-responsive img-markdown" /></p>
<p>Ideally the header image should be flush with the top of the page and the footer image flush with the bottom of the page.</p>
<p>The code is fairly basic currently:</p>
<pre><code>[MiddlewareFilter(typeof(JsReportPipeline))]
public override IActionResult Index()
{
       var headerPath = _env.WebRootFileProvider.GetFileInfo(&quot;templates/header.html&quot;).PhysicalPath;

       var header = System.IO.File.ReadAllText(headerPath);

       HttpContext.JsReportFeature()
              .Recipe(Recipe.ChromePdf)
              .Configure((r) =&gt; r.Template.Chrome = new Chrome
              {
                     FooterTemplate = header,
                     HeaderTemplate = header,
                     DisplayHeaderFooter = true,
                     MarginTop = &quot;3cm&quot;,
                     MarginLeft = &quot;1cm&quot;,
                     MarginBottom = &quot;3cm&quot;,
                     MarginRight = &quot;1cm&quot;,
                 });

       QuotePdfModel model = new QuotePdfModel();

       return View(&quot;Quote&quot;, model);
}
</code></pre>
<p>And the <code>header.html</code> template (with the whole base64 image removed because it's massive):</p>
<pre><code>&lt;!doctype html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head style=&quot;display: none;&quot;&gt;
&lt;/head&gt;
&lt;body style=&quot;margin: 0;&quot;&gt;
    &lt;div style=&quot;height: 100px;&quot;&gt;
        &lt;img style=&quot;width:100%; height:100%;&quot;
        src=&quot;data:image/jpeg;base64,...&quot; /&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;

</code></pre>
<p>Any suggestions to remove the white bars?</p>
<p>Cheers,<br />
Mark V</p>
]]></description><link>https://forum.jsreport.net/topic/2230/white-bar-in-header-and-footer</link><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Mar 2026 03:45:42 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/2230.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 09 Dec 2021 11:10:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to White bar in header and footer on Invalid Date]]></title><description><![CDATA[<p>Hey,</p>
<p>I'm trying to create a pdf with a header/footer image flush with the page. I've managed to get an image rendering using a base64 image but on both the header and footer there is a small white bar that I cannot figure out how to get rid of.</p>
<p><img src="/uploads/files/1639047343728-upload-c9c8f331-76b7-4c31-8925-ebd82c4f82ef-resized.png" alt="0_1639047341976_upload-c9c8f331-76b7-4c31-8925-ebd82c4f82ef" class="img-responsive img-markdown" /></p>
<p>Ideally the header image should be flush with the top of the page and the footer image flush with the bottom of the page.</p>
<p>The code is fairly basic currently:</p>
<pre><code>[MiddlewareFilter(typeof(JsReportPipeline))]
public override IActionResult Index()
{
       var headerPath = _env.WebRootFileProvider.GetFileInfo(&quot;templates/header.html&quot;).PhysicalPath;

       var header = System.IO.File.ReadAllText(headerPath);

       HttpContext.JsReportFeature()
              .Recipe(Recipe.ChromePdf)
              .Configure((r) =&gt; r.Template.Chrome = new Chrome
              {
                     FooterTemplate = header,
                     HeaderTemplate = header,
                     DisplayHeaderFooter = true,
                     MarginTop = &quot;3cm&quot;,
                     MarginLeft = &quot;1cm&quot;,
                     MarginBottom = &quot;3cm&quot;,
                     MarginRight = &quot;1cm&quot;,
                 });

       QuotePdfModel model = new QuotePdfModel();

       return View(&quot;Quote&quot;, model);
}
</code></pre>
<p>And the <code>header.html</code> template (with the whole base64 image removed because it's massive):</p>
<pre><code>&lt;!doctype html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head style=&quot;display: none;&quot;&gt;
&lt;/head&gt;
&lt;body style=&quot;margin: 0;&quot;&gt;
    &lt;div style=&quot;height: 100px;&quot;&gt;
        &lt;img style=&quot;width:100%; height:100%;&quot;
        src=&quot;data:image/jpeg;base64,...&quot; /&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;

</code></pre>
<p>Any suggestions to remove the white bars?</p>
<p>Cheers,<br />
Mark V</p>
]]></description><link>https://forum.jsreport.net/post/9722</link><guid isPermaLink="true">https://forum.jsreport.net/post/9722</guid><dc:creator><![CDATA[MarkVFwd]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to White bar in header and footer on Invalid Date]]></title><description><![CDATA[<p>I found the solution here<br />
<a href="https://github.com/puppeteer/puppeteer/issues/4132" rel="nofollow">https://github.com/puppeteer/puppeteer/issues/4132</a></p>
<pre><code>&lt;style&gt;#header, #footer { padding: 0 !important; }&lt;/style&gt;
</code></pre>
]]></description><link>https://forum.jsreport.net/post/9723</link><guid isPermaLink="true">https://forum.jsreport.net/post/9723</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to White bar in header and footer on Invalid Date]]></title><description><![CDATA[<p>That's fixed it!</p>
<p>Thanks, Jan 😀</p>
]]></description><link>https://forum.jsreport.net/post/9724</link><guid isPermaLink="true">https://forum.jsreport.net/post/9724</guid><dc:creator><![CDATA[MarkVFwd]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>