Footer Formatting Problems within custom print format

Hey everyone,

I’m running into issues with format prints, especially with the footer. I’m dynamically generating sales invoices and used this GitHub resource: ERPNext Print Format to split tables over pages, which works great. However, I’ve struggled to consistently place a footer on every page or just the first page of my print format.

Here’s what I’ve tried so far:

  • Using both HTML footers and image footers in letter head, but the problem persists.
  • Setting the footer to position: absolute and bottom: 0. This resulted in a footer with a 3 cm top margin, and I can’t figure out why.
  • Reinsatlled the proper version of wkhtmltopdf

Has anyone successfully implemented a working footer in this context? Any insights or examples would be greatly appreciated!

My simple example footer:

<div class="footer">
    <table>
        <tbody>
            <tr>
                <td width="33%">
                    <p style="font-weight: bold; font-size: 12px; color: #333; margin-bottom: 5px; text-transform: uppercase;">Company Name</p>
                    <p>Street Address</p>
                    <p>City, Postal Code</p>
                    <p>Country</p>
                </td>
                <td width="33%">
                    <p style="font-weight: bold; font-size: 12px; color: #333; margin-bottom: 5px; text-transform: uppercase;">Bank Details</p>
                    <p>Bank Name</p>
                    <p>IBAN: XXXX</p>
                    <p>BIC: XXXX</p>
                    <p>Tax ID: XXXX</p>
                </td>
                <td width="33%">
                    <p style="font-weight: bold; font-size: 12px; color: #333; margin-bottom: 5px; text-transform: uppercase;">Contact</p>
                    <p>Phone: XXX</p>
                    <p>Email: example@example.com</p>
                    <p>Web: www.example.com</p>
                </td>
            </tr>
        </tbody>
    </table>
</div>

And what i have use to bring it into my custom print format:

{{ footer }}

Thanks!