from ironpdf import * html = "<p>Lorem ipsum dolor sit amet..." renderer = ChromePdfRenderer() renderer.RenderingOptions.PaperSize = PdfPaperSize.Custom renderer.RenderingOptions.SetCustomPaperSizeInInches(5.0, 5.0) pdf = renderer.RenderHtmlAsPdf(html) pdf.SaveAs("CustomPaperSize.pdf")