HTML Rendering Settings
IronPDF for Python exposes a rich set of rendering options through the ChromePdfRenderer.RenderingOptions property, giving you precise control over every aspect of the generated PDF.
Getting Started
Instantiate a ChromePdfRenderer, adjust the properties on its RenderingOptions object, and then call one of the render methods. Every option you set is applied to all PDFs produced by that renderer instance.
Understanding the Code
SetCustomPaperSizeInInches: Defines a non-standard page width and height in inches.PrintHtmlBackgrounds: WhenTrue, CSS background colors and images are included in the output.PaperOrientation: AcceptsPdfPaperOrientation.LandscapeorPortrait.Title: Sets the internal document title visible in PDF metadata.EnableJavaScript: Allows inline<script>blocks and external scripts to execute before the PDF is rendered.WaitFor.RenderDelay: Pauses rendering for a specified number of milliseconds, useful when JavaScript needs time to complete.CssMediaType: Switch betweenScreenandPrintCSS rules to control which stylesheet is applied.FitToPaperMode: Controls how content is scaled to fit the page (e.g.,Zoom,AutomaticFit).Zoom: Percentage zoom level applied to the page content.CreatePdfFormsFromHtml: WhenTrue, HTML<input>and<select>elements are converted to interactive PDF form fields.MarginTop / MarginLeft / MarginRight / MarginBottom: Set page margins in millimeters.FirstPageNumber: Starting page number, useful when a cover page will be prepended to the document.
Applying Options
All options are set before calling a render method such as RenderUrlAsPdf, RenderHtmlAsPdf, or RenderHtmlFileAsPdf. The renderer can be reused across multiple render calls with the same settings.






