IRONSOFTWAREHOME

How to Configure Print Settings in C# with IronPrint

Curtis Chau
Curtis Chau
Updated: August 2, 2026

Configure print settings in C# using IronPrint's PrintSettings class to control paper size, orientation, DPI, margins, and more. Simply instantiate PrintSettings, set your preferences, and pass it to the Print method.

Quickstart: Configure Print Settings
  1. Install IronPrint via NuGet: Install-Package IronPrint
  2. Add using IronPrint; to the file
  3. Create a PrintSettings object
  4. Set properties like PaperSize, Dpi, PaperOrientation, NumberOfCopies, and Grayscale
  5. Pass settings to Printer.Print() or Printer.ShowPrintDialog()
  1. 1Install IronPrint with NuGet Package Manager

    PM > Install-Package IronPrint

  2. 2Copy and run this code snippet.

    using IronPrint;
    
    // Print with custom settings
    Printer.Print("document.pdf", new PrintSettings
    {
        PaperSize = PaperSize.A4,
        PaperOrientation = PaperOrientation.Landscape,
        Dpi = 300,
        NumberOfCopies = 2,
        Grayscale = true
    });
    C#
  3. 3Deploy to test on your live environment

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

How Do I Set Print Settings?

To configure print settings, instantiate the PrintSettings class and configure it according to your preferences. In the Print or ShowPrintDialog methods, pass the PrintSettings object as the second parameter. The code example below illustrates this usage. For more detailed examples, check the print settings code examples page.

// Import the necessary namespace for IronPrint
using IronPrint;

// Path to the document you want to print
string document = "document.pdf";

// Initialize a new instance of the PrintSettings class
PrintSettings settings = new PrintSettings();

// Configure various print settings
settings.PaperSize = PaperSize.A4;                // Set paper size to A4
settings.PaperOrientation = PaperOrientation.Landscape; // Set paper orientation to Landscape
settings.Dpi = 300;                               // Set print resolution to 300 DPI
settings.NumberOfCopies = 2;                      // Set the number of copies to 2
settings.PrinterName = "MyPrinter";               // Set the name of the printer
settings.PaperMargins = new Margins(10, 10, 10, 10); // Set margins to 10mm on each side
settings.Grayscale = true;                        // Print in grayscale

// Use the PrintSettings in the Print method
IronPrint.Printer.Print(document, settings);
C#

Why Do I Need to Configure Print Settings?

A print setting refers to a configuration or set of parameters that dictate how a document or content should be printed. These settings include details such as paper size, orientation (portrait or landscape), print resolution (dots per inch - DPI), the number of copies, printer selection, margins, and options like grayscale printing. Customize these settings to achieve specific printing preferences and requirements.

IronPrint's comprehensive print settings features provide developers with fine-grained control over every aspect of the printing process. Whether building desktop applications or ASP.NET web applications, proper configuration ensures consistent results across different environments.

When Should I Use Custom Print Settings?

Custom print settings are essential when precise control over printed output is needed, such as when printing reports with specific margins, generating multiple copies of documents, or ensuring documents print in the correct orientation for business needs.

Here's a practical example for printing invoices with specific requirements:

// Example: Printing invoices with business requirements
using IronPrint;

// Invoice printing with specific business settings
var invoiceSettings = new PrintSettings
{
    PaperSize = PaperSize.Letter,        // US Letter size for business documents
    PaperOrientation = PaperOrientation.Portrait,
    Dpi = 600,                           // High quality for professional output
    NumberOfCopies = 3,                  // Original + customer copy + file copy
    PaperMargins = new Margins(15, 15, 15, 25), // Extra bottom margin for footer
    Grayscale = false,                   // Keep company logo in color
    PrinterName = "Office Color Printer" // Specific high-quality printer
};

// Print the invoice
Printer.Print("invoice_2024_001.pdf", invoiceSettings);

What Happens If I Don't Specify Print Settings?

If print settings aren't specified, IronPrint uses the default settings from your system's default printer, which may not match your intended output format or quality requirements. To discover available printers on your system, use the GetPrinterNames method to retrieve all connected printers programmatically.

What Print Settings Are Available?

Explore all available print settings options below. The complete API reference provides detailed documentation for each property and method:

SettingDescriptionDefault ValueRemarks
DefaultSettingsInitializes a new instance of the IronPrint.PrintSettings class with default valuesN/AN/A
PaperSizeSets the paper size used by the printerIronPrint.PaperSize.PrinterDefaultN/A
PaperOrientationSpecifies the paper orientation (e.g., Portrait or Landscape)IronPrint.PaperOrientation.PortraitN/A
DpiRepresents the intended print resolution in dots per inch300The actual DPI used for printing might be limited by the capabilities of the printer
NumberOfCopiesIndicates the number of identical copies to be generated when printing a document1In certain platforms, limitations may exist that prevent the accurate reproduction of multiple copies. In such cases, the specified value of IronPrint.PrintSettings.NumberOfCopies might be ignored, resulting in only one copy being printed
PrinterNameSpecifies the name of the printer to use for printingnull (uses OS default printer)If you choose the printer in a PrintDialog, this setting will be ignored. To obtain the available printer names, you can use IronPrint.Printer.GetPrinterNames or IronPrint.Printer.GetPrinterNamesAsync to fetch the printer name list
PaperMarginsSets the margins to use for printing in millimetersnull (uses printer default margins)N/A
GrayscaleIndicates whether to print in grayscalefalse (attempts color printing)N/A
FlattenFlatten the PDF before printing, which is useful for displaying form field values and imagesfalseN/A
TrayPrinter tray used for the printing job. This allows users to specify a particular tray from which paper should be fed into the printernull (uses printer default tray)If you choose the tray in a PrintDialog, this setting will be ignored. To obtain the available tray, you can use IronPrint.Printer.GetPrinterTrays(System.String) or IronPrint.Printer.GetPrinterTraysAsync(System.String). This tray selection property is available only in Windows

Which Print Settings Should I Always Configure?

For most business applications, always configure PaperSize, PaperOrientation, and Dpi to ensure consistent output across different printers and systems. These three settings have the most impact on document appearance and readability.

When working with dialog-based printing, combine custom settings with user interaction using the ShowPrintDialog method:

// Pre-configure settings but allow user to modify
var presetSettings = new PrintSettings
{
    PaperSize = PaperSize.A4,
    PaperOrientation = PaperOrientation.Portrait,
    Dpi = 300
};

// Show dialog with preset values
Printer.ShowPrintDialog("report.pdf", presetSettings);

How Do I Handle Platform-Specific Settings?

Some settings like Tray selection are only available on Windows. Always check platform compatibility when using platform-specific features, and provide fallback behavior for cross-platform applications. For troubleshooting platform-specific issues, consult the engineering support guide.

What Are Common Print Setting Combinations?

Common combinations include A4/Portrait/300 DPI for standard documents, A3/Landscape/600 DPI for detailed reports, and Letter/Portrait/300 DPI/Grayscale for draft printing to save ink.

Here's an example showcasing different scenarios:

// Standard office document
var standardDocument = new PrintSettings
{
    PaperSize = PaperSize.A4,
    PaperOrientation = PaperOrientation.Portrait,
    Dpi = 300
};

// Detailed engineering drawing
var technicalDrawing = new PrintSettings
{
    PaperSize = PaperSize.A3,
    PaperOrientation = PaperOrientation.Landscape,
    Dpi = 600,
    Grayscale = false
};

// Draft mode for review
var draftMode = new PrintSettings
{
    PaperSize = PaperSize.Letter,
    PaperOrientation = PaperOrientation.Portrait,
    Dpi = 150,
    Grayscale = true,
    NumberOfCopies = 5
};

// High-volume batch printing
var batchPrint = new PrintSettings
{
    PaperSize = PaperSize.A4,
    PaperOrientation = PaperOrientation.Portrait,
    Dpi = 300,
    NumberOfCopies = 100,
    Tray = "Tray 2" // Large capacity tray on Windows
};

For more comprehensive examples and advanced printing scenarios, explore the print document tutorial which covers the complete printing workflow from start to finish.

When implementing print settings in production environments, especially in web applications using Web.config, review the guide on setting license keys in Web.config to ensure proper configuration.

Frequently Asked Questions

How do I configure print settings with IronPrint in C#?

To configure print settings in C#, use IronPrint's `PrintSettings` class. Instantiate this class, set preferences like paper size, DPI, and orientation, and then pass it to the `Print` method.

What are the essential print settings I should configure?

For most applications, configure `PaperSize`, `PaperOrientation`, and `Dpi` to ensure consistent document appearance and readability across different printers.

Can I print documents in grayscale using IronPrint?

Yes, you can print documents in grayscale by setting the `Grayscale` property in the `PrintSettings` class to `true`.

What happens if I don't specify any print settings?

If no print settings are specified, IronPrint will use the default settings from your system's default printer, which may not match your formatting or quality requirements.

How do I install IronPrint in my C# project?

Install IronPrint via NuGet with the command `Install-Package IronPrint`. Then, add `using IronPrint;` to your file to start configuring your print settings.

What are some common print setting combinations?

Common combinations include A4/Portrait/300 DPI for standard documents, A3/Landscape/600 DPI for detailed reports, and Letter/Portrait/300 DPI/Grayscale for draft printing.

How can I handle platform-specific print settings with IronPrint?

Check platform compatibility when using settings like Tray selection, which is only available on Windows. Provide fallback options for cross-platform applications.

Why is it important to configure print settings?

Configuring print settings is crucial to ensure documents print as intended with specific parameters like paper size, margins, and quality, maintaining consistency across different environments.

Can I allow users to modify print settings during the print process?

Yes, you can use the `ShowPrintDialog` method to pre-configure settings and allow users to modify them before printing.

What options are available for printing multiple copies of a document?

You can print multiple copies by setting the `NumberOfCopies` property in the `PrintSettings` class. Note that some platforms may have limitations on reproducing multiple copies.

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