How to add page numbers in print format that shows in pdf

I want page numbers in footer section of page in print format , that no shows in pdf .
me trying different types of code but new version of frappe they not work, can any one do thatPreformatted text

work in old frappe version code:
<div id="footer-html" class="visible-pdf"> {% if not no_letterhead and footer %} <div class="letter-head-footer"> {{ footer }} </div> {% endif %} <p class="text-center small page-number visible-pdf"> {{ _("Page {0} of {1}").format('<span class="page"></span>', '<span class="topage"></span>') }} </p> </div>

Any Solution for that?

Any update on this?

You can try add :

<style>
        @media print {
            body {
                counter-reset: page 1;
            }
            footer {
                position: fixed;
                bottom: 0;
            }
            @page {
                counter-increment: page;
            }
            footer:after {
                content: "Page " counter(page);
            }
        }
    </style>
1 Like

estoy trabajando con erpnext versión 14 y quiero mostrar la numeración de las páginas en el formato de impresión. cómo podría hacerlo?