Custom footer and page number?


Is there a way to add footer in print format?
How to add page number?
Also letter head in all pages.

Any reference to third party documentation also helpful.


For footer use “Terms and Coditions”
For page number, may be you can use Default Print Settings of browser.
And for letter head in all pages, you have to figure out the length of the page which is difficult to find considering difference page size and contents. Thats why in erpnext, we have given an option to select “Page Break” in each row of the item table.

I think a custom print format using html and jinja2 code could also be a solution.

thanks @nabinhait
using this I can get page break and letter head.
This is fine for me, because I don’t have long terms and condition.

<div class="page-break"></div>

{{ add_header(0,1,doc,letter_head, no_letterhead) }} 

I am using custom print format.
Can you give some example to create page number?

1 Like

just a rough sketch, I remember doing something like this once :

during initialize

{% set total_pages = [1] %}

at the time of page break

<div class="page-break"></div>
{% if total_pages.append('1') %} {% endif %}


<div> Page No  {{ total_pages|length }} </div>

I will try it

hey had u tried?

@vivek_ilexSquare now erpnext has feature to add header and footer.

Please refer following code

1 Like

I am new to ERPNEXT and i am not getting how to and where to apply these settings.
what i got is this file, in which it says that no standard footer is provided. And to make footer I have to use terms and condition column

i also tried jinza bt i whole code is shown as text
this is snapshot.

Thank You.

I am talking about this settings.

If you are new, then no need to write any code for footer.
Please open letter head, you will find footer section.


This footer section is not working in sales invoice
whenever i print sales invoice then only header part is showing, footer part is missing.

Thank You.

At the end of this document it is also written:

Please note that Footer will be visible only when document’s print is seen in the PDF. Footer will not be visible in the HTML based print preview.
I am not getting what is this…

You can see footer on pdf, so click on pdf button on print

1 Like

I got this.

But if in future i have to change properties like length width etc then from where i can edit them.
Thank You.

@vivek_ilexSquare in future you can make custom print format in frappe, then you can refer above link shared by me.

ohkkk .
Thanks a lot…