Pagination in Head

Hi all,

I m setting up my print format with printformat builder and HTML fields.
We are using envelopes with clear windows for address so I need my address area in a stable
position.

Depending on wether the pagination and document status show up or not
the address area is moving up or down.

I managed to hide the native pagination via

 .page-number  {
display: none;
}

but I need it in the Head of the document so it doesnt move my address area
hence I tried to fetch page number and max. page number with

{{ _("Page #{0} of {1}").format(page_num, max_pages) }}

in the Head of print format builder …but output is
Page #{{ page_num }} of {{ max_pages }}
rather then
Page # 1 of 2
what am I doing wrong?

rgds

Try putting {{ page_num }} {{ max_pages }} and see if it has incorrect values in it

Hi @anad

unfortionatly nothing… see file attached
tried in header and normal HTML field

rgds

Hi

any ideas why it doesnt work???

rgds

Edit: This doesn’t work.

Hi @cpurbaugh

yes it doesnt but do you know why??

My original post was a proposed solution. I tried it and it didn’t work, so that’s why my last post says what it does. I’ve got no ideas.

Hi @cpurbaugh

I see Thanks :smile:

meanwhile I have a workaround
in frappe-bench/apps/frappe/frappe/templates/print_formats(standart_macros.html
line 137 to 140

    {% if max_pages >= 1 %}
    <p class="text-right page-number">{{ _("Seite {0} von {1}").format(page_num, max_pages) }}</p>
    {% endif %}

by that it is there permanently but so it doesnt change the rest of the layout

rgds

obsolete can be closed