Add footer only in the last print page

Hi everyone,
I am using a custom print format, and if we have multiple pages, I only want the footer to appear at the last page of pdf .
When I use code below the footer appears on every page

<div class="visible-pdf"id="footer-html"  >
    <table  style="width:24.2cm;" border="0" cellspacing="0" cellpadding="0" >
        <tr>
            <td style="width: 69%; text-align:center; font-size:11px;"> {{doc.in_words}}</td>
            <td style="width: 31%;font-size:11px;">{{"{:,.2f}".format(doc.total)}}</td>
        </tr>
    <tr>
        <td><br></td>
        <td style="font-size:11px;">{{"{:,.2f}".format(doc.total_taxes_and_charges)}}</td>
    </tr>
    <tr>
        <td><br></td>
        <td style="font-size:11px;">{{"{:,.2f}".format(doc.discount_amount)}}</td>
    </tr>
    <tr>
        <td><br></td>
        <td style="font-size:11px;">{{"{:,.2f}".format(doc.grand_total)}}</td>
    </tr>
    <tr>
            <td style="font-size:11px;"><br> {{ frappe.get_fullname(doc.owner) }}</td>
    </tr>
</table>

@atul_sah Can you please look into it? I also need to know the answer of this question.

You can possibly try to uncheck “Repeat header and footer in PDF” in “Print Settings” and make a custom print format as per your needs.

1 Like

Thanks @Pawan
Will it effect on other print formats…?

This is not working as expected.

I am also looking. something like the below screen.

if the print has multiple pages then repeat the Header on every page and Footer on Last Page. if the print has only one page then the footer should print on the bottom.

Yes its a global setting

As i said in the earlier post, you have to disable it AND create a custom print format.

Thanks for your reply @Pawan

While Unchecking the “Repeat header and footer in PDF” its effecting each and every print format ,The issue I am facing is only on one print format as i mentioned above code