Letter Head and Footer is not repeating in every page

hy, can anyone help me with this issue?

i had created letter head and a custom print format.
i used this code in my print format code.

{%- macro add_header(page_num, max_pages, doc, letter_head, no_letterhead) -%}
{% if letter_head and not no_letterhead %}

{{ letter_head }}

{% endif %}

{% if max_pages > 1 %}
<p class="text-right">{{ _("Page #{0} of {1}").format(page_num, max_pages) }}</p>
{% endif %}

{%- endmacro -%}
{{ add_header(0,1,doc,letter_head, no_letterhead) }}

the issue that im facing is, letterhead is only showing in first page. not repeating in other pages. same issue with footer also.