using IronPdf;
// Create a new PDF and print it
var renderer = new ChromePdfRenderer();
PdfDocument 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 PdfDocument.GetPrintDocument
//Remember to add an assembly reference to System.Drawing.dll or System.Drawing.Common via NuGet.
System.Drawing.Printing.PrintDocument printDocYouCanWorkWith = pdf.GetPrintDocument();
Imports IronPdf
' Create a new PDF and print it
Private renderer = New ChromePdfRenderer()
Private pdf As PdfDocument = 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 PdfDocument.GetPrintDocument
'Remember to add an assembly reference to System.Drawing.dll or System.Drawing.Common via NuGet.
Dim printDocYouCanWorkWith As System.Drawing.Printing.PrintDocument = pdf.GetPrintDocument()
Prints a PDF by sending it to the computer's default printer. Windows print UI dialogs may be displayed to the user, or we can print silently using the overloads of the IronPdf.PdfDocument.Print method.
More printing options are exposed to the native .NET Framework PrintDocument object via the IronPdf.PdfDocument.GetPrintDocument method. To use this method, you will need to add an assembly reference to System.Drawing.dll.
Related Docs Links
Ready to get started? Version: 2024.12 just released