Print format setting: Repeat only footer

Hi,

I noticed the Print Settings has this option:

Is it possible to repeat just the footer on each page? Id would be great if the header and footer would be split into separate options. On the first page of a pdf document I’d like both footer and header, but to save space it would be great if I could repeat just the footer. Is this possible to accomplish currently with some custom formating?

Hi @oluukkan,

as a core option this is not available, but the platform can certainly do this. Look into the “custom format” option: this allows you to freely define headers and footers, and how they should be repeated.


For example, define your format like this and it will achieve exactly that:

<!-- HEADER (only first page) -->
<!-- your letter head here -->


<!-- your content here -->

<!-- FOOTER (every page) -->
<div id="footer-html" class="visible-pdf">
   <center><p style="font-size: 8pt !important;">{{ _("Page") }} <span class="page"></span> {{ _("of") }} <span class="topage"></span></p></center>
</div>

Hope this helps.

@lasalesi Thanks for your comment.

Currently the Header and Footer are defined in a Letter Head from the Setup module. Can I somehow add these to the custom print format?

Also, is there an official channel for feature requests where I could submit this sugestion? It would be great to have this option nativly in an upcoming version.

Hi @oluukkan,

sure, you can pull the content of a letter head into he print format like so:

{% set letter_head = frappe.get_doc("Letter Head", "Commercial") %}
{% if letter_head %}
  {{ letter_head.content }}
{% else %}
  <p>Letter head Commercial not found. Please define the letter head under print settings.</p>
{% endif %}

and in the footer

<!-- page footer -->
<div     id="footer-html" class="visible-pdf">
       <center><p style="font-size: 8pt !important;">{{ _("Page") }} <span class="page"></span> {{ _("of") }} <span class="topage"></span></p></center>
       {% if letter_head %}
         {{ letter_head.footer }}
       {% else %}
         <p>No letter head found. Please define a letter head under print settings and mark it as default</p>
       {% endif %}</span></p>
    </div>

You can place feature requests directly on GutHub: Issues · frappe/erpnext · GitHub (mark as feature request).

2 Likes

This does not help me, I am not getting the header and footer on all print pages,
can you please help.
I want the letter head and footer on every page when I print.
Tried Everything but nothing is helping