Paper Printing PDFs
from ironpdf import *
 
# Create a new PDF and print it
renderer = ChromePdfRenderer()
pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf")

# Send the PDF to the default printer to print
# 300 DPI, no user dialog this time ... many overloads to this method
pdf.Print(300)

# For advanced printing, we can also use pdf.GetPrintDocument()
printer_setting = pdf.GetPrintDocument()
printer_setting.PrinterSettings.FromPage = 2
printer_setting.PrinterSettings.ToPage = 4
printer_setting.Print()
pip install ironpdf
Paper Printing PDFs

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.

Ready to Get Started?

Version:2026.11just released