IRONSOFTWAREHOME

C# Print Document Tutorial with IronPrint

Curtis Chau
Curtis Chau
Updated: August 2, 2026

IronPrint is a powerful printing library designed to assist .NET C# developers in integrating printing capabilities into their applications. With a broad compatibility spectrum spanning across Windows, macOS, iOS, and Android platforms, IronPrint works consistently and reliably across diverse operating systems. Whether you are creating applications for desktop environments, Apple's macOS ecosystem, or mobile platforms like iOS and Android, IronPrint simplifies the implementation of printing features, providing a versatile and user-friendly solution for all your printing needs in the .NET C# environment.

Quickstart: Silently Print a Document with IronPrint

Just one line of code and you're printing - no dialogs, no fuss. Use IronPrint.Printer.Print(...) to silently send PDFs or images straight to the printer using default or custom settings.

  1. 1Install IronPrint with NuGet Package Manager

    PM > Install-Package IronPrint

  2. 2Copy and run this code snippet.

    IronPrint.Printer.Print("path/to/your/document.pdf");
    C#
  3. 3Deploy to test on your live environment

    Start using IronPrint in your project today with a free trial
    arrow pointer

Table of Contents

Print documents seamlessly without displaying the print dialog. The print settings can then be done directly within the code.

// Programmatically print a document without showing the print dialog.
// Define your print job and settings here as needed.

using System;
using IronPrint;

public class SilentPrint
{
    public static void Main()
    {
        // Apply specific settings as necessary
        // For example: set printer name, copies, etc.
        var settings = new PrintSettings();

        // Print the document without displaying the print dialog
        Printer.Print("sample-document.pdf", settings);
    }
}
C#

Initiate the printing process with the print setting dialog displayed. This allows users to customize print options interactively.

// Start a print job with user interaction through the print dialog.

using System;
using IronPrint;

public class DialogPrint
{
    public static void Main()
    {
        var settings = new PrintSettings();

        // Show the print dialog so the user can customize print options
        Printer.ShowPrintDialog("sample-document.pdf", settings);
    }
}
C#

Apply Print Settings

Programmatically adjust print settings to meet specific requirements. This section provides the capability to fine-tune printing configurations through code.

// Example code to apply custom print settings programmatically.

using System;
using IronPrint;

public class PrintSettingsExample
{
    public static void Main()
    {
        // Set custom print settings such as grayscale and number of copies
        var settings = new PrintSettings
        {
            Grayscale = false,
            NumberOfCopies = 2
        };

        // Print the document using the configured settings
        Printer.Print("sample-document.pdf", settings);
    }
}
C#

Get Printer Information

Get Printer Names

Access a list of all available printers. Retrieve the names of printers installed on the system for informative purposes or dynamic printer selection in your application.

// Retrieve and display a list of printer names available on the system.

using System;
using IronPrint;

public class PrinterInfo
{
    public static void Main()
    {
        // Get an enumerable list of printer names
        var printerNames = Printer.GetPrinterNames();

        // Print each printer name to the console
        Console.WriteLine("Available Printers:");
        foreach (var name in printerNames)
        {
            Console.WriteLine(name);
        }
    }
}
C#

Frequently Asked Questions

What platforms does IronPrint support for printing documents?

IronPrint supports printing across a wide range of platforms including Windows, macOS, iOS, and Android, ensuring seamless integration in diverse operating systems.

How can I print a document without displaying the print dialog using IronPrint?

With IronPrint, you can silently print a document using a single line of code: `IronPrint.Printer.Print("path/to/your/document.pdf");`. This allows you to send PDFs directly to the printer without any dialog interruptions.

Can I customize print settings programmatically using IronPrint?

Yes, you can programmatically customize print settings with IronPrint by defining settings such as printer name, copies, and more within your C# application code.

Is it possible to interactively set print options with IronPrint?

IronPrint allows users to start a print job with interactive options by utilizing the print dialog, which helps customize various print settings according to user preferences.

How do I retrieve the names of available printers using IronPrint?

You can retrieve the list of available printers using IronPrint by implementing the `Printer.GetPrinterNames()` method, which provides an enumerable list of printer names installed on the system.

What are some of the document types IronPrint can handle?

IronPrint can handle multiple document types including PDF, PNG, HTML, TIFF, GIF, JPEG, and more, making it a versatile tool for various printing needs.

Is IronPrint compatible with both desktop and mobile applications?

Yes, IronPrint is compatible with both desktop environments (Windows and macOS) and mobile platforms (iOS and Android), allowing for flexible printing solutions across different devices.

Can IronPrint perform grayscale printing and adjust the number of copies programmatically?

Yes, you can set custom print settings such as enabling grayscale and specifying the number of copies directly within your C# code using IronPrint's `PrintSettings` class.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Nuget Downloads 46,090Version:2026.9just released

Get your FREE

30-day Trial Key instantly.

bullet_checkedNo credit card or account creation required
bullet_testTest in production
without watermarks
bullet_calendar30 days fully
functional product
bullet_support24/5 technical
support during trial
Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package IronPrint
nuget.org/packages/IronPrint/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronPrint"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

  1. Download and unzip IronPrint to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronPrint.dll"

Licenses from $999

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required