Runnable C# examples for IronPrint, a .NET printing library that sends PDFs, images, and documents to physical and virtual printers without shelling out to an external viewer.
dotnet add package IronPrintusing IronPrint;
License.LicenseKey = "YOUR-LICENSE-KEY";
// Print silently to the default printer
Printer.Print("invoice.pdf");Printer.ShowPrintDialog(path) prints through the platform dialog instead, and Printer.GetPrinterNames() returns the printers the machine can see. To control the job, pass a PrintSettings — paper size, orientation, DPI, number of copies, grayscale, and the target printer name.
Without a license key, printed output includes a watermark.
Each folder contains a self-contained .NET project you can open and run:
examples/— focused snippets demonstrating individual featuresget-started/— license-key setuphow-to/— task-oriented guides, including printing from an ASP.NET web applicationquickstart/— an end-to-end project scaffoldtutorials/— a longer walkthrough covering document printing end to end
- Silent printing to the default or a named printer
- Printing through the platform print dialog
- Enumerating the printers available on the machine
PrintSettings: paper size, orientation, DPI, number of copies, grayscale, margins- Printing PDFs and images
- Printing from an ASP.NET web application
.NET 7, .NET 6, .NET Core 3.1, and .NET Framework 4.6.2+, including the .NET MAUI target frameworks for Windows, macOS, Mac Catalyst, iOS, and Android. See the documentation for environment-specific notes.
- Full documentation: ironsoftware.com/csharp/print/docs
- API reference: ironsoftware.com/csharp/print/object-reference/api
- Issues with these examples: file directly on this repository
- Product support: support@ironsoftware.com
This repository is maintained by Iron Software. IronPrint is a commercial library — see licensing for terms and trial details.