Issues faced:
- Letterhead does not repeat on every page of the pdf.
- class ‘visible-pdf’ does not work in custom print formats?
- When tried without using the class ‘visible-pdf’, the footer does not appear at the bottom. Instead, it appears in the body(just after the content end).
Approaches tried:
1. basic
<div class="row">
<div class="col-xs-12">
{{ letter_head }}
</div>
</div>
<div id="footer-html" class="visible-pdf">
{% if not no_letterhead and footer %}
<div class="letter-head-footer">
{{ footer }}
</div>
{% endif %}
</div>
2. Using standard.html format
<div class="row">
<div {% if print_settings.repeat_header_footer %} id="header-html" class="hidden-pdf" {% endif %}>
{{ letter_head }}
</div>
</div>
{% if print_settings.repeat_header_footer %}
<div id="footer-html" class="visible-pdf">
{% if not no_letterhead and footer %}
<div class="letter-head-footer">
{{ footer }}
</div>
{% endif %}
</div>
{% endif %}
3. Using Frappe print setting explicitly
{% for page in layout %}
<div {% if (frappe.get_doc("Print Settings").repeat_header_footer) %} id="header-html" class="hidden-pdf" {% endif %} >
<div class="col-xs-12">
{{ letter_head }}
</div>
</div>
{% if (frappe.get_doc("Print Settings").repeat_header_footer) %}
<div id="footer-html">
{% if not no_letterhead and footer %}
<div class="letter-head-footer">
{{ footer }}
</div>
{% endif %}
</div>
{% endif %}
{% endfor %}