Paper Printing PDFs
IronPDF for Python can send PDF documents directly to a physical printer using the Print method, with optional DPI control and the ability to configure advanced printer settings through GetPrintDocument.
Getting Started
Render or load a PdfDocument, then call Print to send it to the default printer. For more control — such as specifying a page range or choosing a specific printer — use GetPrintDocument to access the full print configuration.
Understanding the Code
pdf.Print(dpi): Sends all pages of the PDF to the default system printer at the specified DPI resolution. The example uses 300 DPI for high-quality output. No print dialog is shown.pdf.GetPrintDocument(): Returns a print document object that exposes detailed printer settings.printer_setting.PrinterSettings.FromPage: The first page number to print (1-based).printer_setting.PrinterSettings.ToPage: The last page number to print (1-based).printer_setting.Print(): Executes the print job with the configured settings.
Specifying a Printer
To print to a specific printer rather than the system default, set printer_setting.PrinterSettings.PrinterName to the printer's name as it appears in the operating system before calling printer_setting.Print().
Silent vs. Dialog Printing
Calling pdf.Print(dpi) prints silently without showing a dialog. To display the system print dialog, use the GetPrintDocument approach and invoke the dialog through the print document API.






