Page number in the Print format

Hi All,

I am trying to fetch the current page number and total page number in the CUSTOM print format. I am unable find the variable to fetch the current and total page number in the custom print format. I am currently using version 14 erpnext. Any help would be highly appreciated. Thank you.

use this code and modify accordingly

<div>
		<div id="footer-html" class="visible-pdf">
			<p style="margin-top: 0; margin-bottom: 0">
			<font face="Calibri" style="font-size: 8pt">{% if not no_letterhead and footer %}
			</font>
			</p>
			<div  style="height: -15mm" class="letter-head-footer">
				<p style="margin-top: 0; margin-bottom: 0">
				<font face="Calibri" style="font-size: 8pt">{{ footer }}
			</font>
			</div>
			<p style="margin-top: 0; margin-bottom: 0">
			<font face="Calibri" style="font-size: 8pt">{% endif %}
			</font>
			</p>
			<p class="text-center small page-number visible-pdf" style="margin-top: 0; margin-bottom: 0" align="right">
			<font face="Calibri" style="font-size: 8pt">Reservation Form</font></p>
			<p class="text-center small page-number visible-pdf" style="margin-top: 0; margin-bottom: 0" align="center">
				<font face="Calibri" style="font-size: 8pt">{{ _("Page {0} of {1}").format('</font><span class="page"></span><font face="Calibri" style="font-size: 8pt">', '</font><span class="topage"></span><font face="Calibri" style="font-size: 8pt">') }}</font></p>
		</div>
		</div>

This code just shows the Page of text but does not displays the actual page number. I have tried this multiple times but this is not working. I am attaching snapshot for your reference.
Screenshot from 2023-12-20 15-03-39

@Sawan_Singh_Parihar

<p class="text-center page-number visible-pdf" style="font-size:13px;">
    {{ _("<b> {0}/{1} </b>").format('<span class="page"></span>', '<span class="topage"></span>') }}
</p>

it will be visible while printing or in pdf view

1 Like

Hi @bahaou I did try this, but the page number is not coming up. I guess the variable to fetch the page number is missing in frappe’s custom print format.

It doesn’t work on V15. on Custom HTML button in standard print format.

Any update on this?