from ironpdf import * url = "http://localhost:51169/Invoice" renderer = ChromePdfRenderer() renderer.RenderingOptions = ChromePdfRenderOptions() renderer.RenderingOptions.MarginTop = 50 renderer.RenderingOptions.MarginBottom = 50 renderer.RenderingOptions.TextHeader = TextHeaderFooter() renderer.RenderingOptions.TextHeader.CenterText = "{pdf-title}" renderer.RenderingOptions.TextHeader.DrawDividerLine = True renderer.RenderingOptions.TextHeader.FontSize = 16 renderer.RenderingOptions.TextFooter = TextHeaderFooter() renderer.RenderingOptions.TextFooter.LeftText = "{date} {time}" renderer.RenderingOptions.TextFooter.RightText = "Page {page} of {total-pages}" renderer.RenderingOptions.TextFooter.DrawDividerLine = True renderer.RenderingOptions.TextFooter.FontSize = 14 renderer.RenderingOptions.CssMediaType = PdfCssMediaType.Print # setting login credentials to bypass basic authentication renderer.LoginCredentials = ChromeHttpLoginCredentials() renderer.LoginCredentials.NetworkUsername = "testUser" renderer.LoginCredentials.NetworkPassword = "testPassword" pdf = renderer.RenderUrlAsPdf(url) pdf.SaveAs("UrlToPdfExample2.Pdf")