from ironpdf import * html = """ <p> Hello Iron</p> <p> This is 1st Page </p> <div style='page-break-after: always;'></div> <p> This is 2nd Page</p> <div style='page-break-after: always;'></div> <p> This is 3rd Page</p> """ # Instantiate Renderer renderer = ChromePdfRenderer() # Configure footer setting footer = HtmlHeaderFooter() footer.MaxHeight = 15 # millimeters footer.HtmlFragment = "<center><i>{page} of {total-pages}</i></center>" footer.DrawDividerLine = True renderer.RenderingOptions.HtmlFooter = footer pdf = renderer.RenderHtmlAsPdf(html) pdf.SaveAs("pageNumber.pdf")