IRONSOFTWAREHOME

How to Set Paper Size for Printing in C#

Curtis Chau
Curtis Chau
Updated: August 2, 2026

IronPrint's PrintSettings class gives developers direct control over paper size through the PaperSize property. We assign a value from the PaperSize enum - such as PaperSize.A4 or PaperSize.Letter - and pass the configured PrintSettings object to any of IronPrint's print methods. The printer then uses that exact paper size for the job.

This guide walks through setting standard paper sizes, combining size with other print settings, and printing asynchronously - all with working C# code.

Quickstart: Set Paper Size
  1. Install IronPrint via NuGet: Install-Package IronPrint
  2. Add using IronPrint; to the file
  3. Create a PrintSettings object
  4. Set PaperSize to any value from the PaperSize enum (e.g., PaperSize.A4)
  5. Pass settings to Printer.Print() or Printer.PrintAsync()
  1. 1Install IronPrint with NuGet Package Manager

    PM > Install-Package IronPrint

  2. 2Copy and run this code snippet.

    using IronPrint;
    
    // Print a PDF on A4 paper
    Printer.Print("report.pdf", new PrintSettings
    {
        PaperSize = PaperSize.A4
    });
    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 Paper Size When Printing in C#?

We set paper size by assigning a value from the PaperSize enum to the PaperSize property on a PrintSettings object. We then pass that object to any of IronPrint's print methods.

using IronPrint;

// Configure print settings with US Letter paper
PrintSettings settings = new PrintSettings();
settings.PaperSize = PaperSize.Letter;

// Print to the default printer
Printer.Print("invoice.pdf", settings);

We first instantiate PrintSettings, which initializes with the printer's defaults. We then override PaperSize with PaperSize.Letter, which maps to the standard 8.5 × 11 inch format. When we call Printer.Print, IronPrint sends the document to the system's default printer using that paper size.

If no PaperSize is specified, IronPrint uses PaperSize.PrinterDefault, which defers to whatever paper size the operating system's default printer is configured to use. This is an essential detail for production environments where printer configurations vary across machines.

Which Paper Sizes Does the Library Support?

The PaperSize enum includes twelve values covering ISO international standards, common US sizes, and the printer default. The table below lists every available option.

Enum ValueStandardDimensions (mm)Dimensions (in)
PaperSize.A0ISO A0841 × 118933.1 × 46.8
PaperSize.A1ISO A1594 × 84123.4 × 33.1
PaperSize.A2ISO A2420 × 59416.5 × 23.4
PaperSize.A3ISO A3297 × 42011.7 × 16.5
PaperSize.A4ISO A4210 × 2978.3 × 11.7
PaperSize.A5ISO A5148 × 2105.8 × 8.3
PaperSize.B4ISO B4250 × 3539.8 × 13.9
PaperSize.B5ISO B5176 × 2506.9 × 9.8
PaperSize.LetterUS Letter216 × 2798.5 × 11.0
PaperSize.LegalUS Legal216 × 3568.5 × 14.0
PaperSize.ExecutiveUS Executive184 × 2677.25 × 10.5
PaperSize.PrinterDefaultPrinter defaultVariesVaries

Each value maps directly to a well-known paper standard. The PrinterDefault option tells IronPrint to use whatever size the printer is currently configured for - useful when you want to respect end-user printer preferences rather than enforcing a specific format.

For a complete API reference, see the PaperSize class documentation.

How Do I Combine Paper Size with Other Print Settings?

The PrintSettings class exposes several properties beyond PaperSize. We can configure orientation, DPI, margins, copy count, and grayscale mode - all in one object.

using IronPrint;

// Configure full print settings
PrintSettings settings = new PrintSettings
{
    PaperSize = PaperSize.A4,
    PaperOrientation = PaperOrientation.Landscape,
    Dpi = 300,
    NumberOfCopies = 3,
    PaperMargins = new Margins(15, 15, 15, 15),
    Grayscale = false
};

// Print the quarterly report
Printer.Print("quarterly-report.pdf", settings);

We use object initializer syntax here for clarity. PaperOrientation rotates the A4 sheet to its wider axis. Dpi at 300 ensures sharp output for charts and fine text. Margins accepts four values in millimeters - top, right, bottom, left - through the Margins constructor. The NumberOfCopies property defaults to 1, but we set it explicitly for readability.

These properties work together without conflict. IronPrint validates the configuration and passes the combined settings to the printer driver as a single print job. For more advanced settings like printer selection and tray configuration, refer to the full print settings guide.

How Do I Print Asynchronously with a Custom Paper Size?

For applications where blocking the main thread is not an option - such as WPF or WinForms apps - we use Printer.PrintAsync. The method accepts the same PrintSettings object and returns a Task.

using IronPrint;
using System.Threading.Tasks;

public class DocumentPrinter
{
    public async Task PrintLegalDocumentAsync(string filePath)
    {
        // Configure Legal paper size
        PrintSettings settings = new PrintSettings
        {
            PaperSize = PaperSize.Legal,
            PaperOrientation = PaperOrientation.Portrait,
            Dpi = 300
        };

        // Print asynchronously
        await Printer.PrintAsync(filePath, settings);
    }
}

This class-based example demonstrates a realistic pattern where a DocumentPrinter service wraps the print logic. We configure PaperSize.Legal (8.5 × 14 inches), which is the standard format for contracts and legal filings. The await keyword ensures the calling thread remains responsive while IronPrint processes the print job.

We can call this method from a button click handler, a background service, or anywhere async/await is supported. IronPrint's async methods - including PrintAsync and ShowPrintDialogAsync - accept the same PrintSettings configuration, so paper size behavior is identical between synchronous and asynchronous paths.

What Are My Next Steps?

We covered how to set paper size in C# using IronPrint's PaperSize enum, from basic single-property configuration to combined settings and asynchronous printing. The PrintSettings class provides a clean, strongly-typed API that eliminates guesswork around paper dimensions.

To continue exploring IronPrint's capabilities:

Start a free 30-day trial to test paper size configuration in your own projects, or view licensing options for production deployment.

Frequently Asked Questions

How do I set a specific paper size for printing in C# using IronPrint?

To set a specific paper size in C#, use IronPrint's `PrintSettings` class. Assign a value from the `PaperSize` enum, such as `PaperSize.A4` or `PaperSize.Letter`, to the `PaperSize` property, and pass the `PrintSettings` object to the `Printer.Print` method.

Can IronPrint handle multiple paper sizes?

Yes, IronPrint supports multiple paper sizes through the `PaperSize` enum, which includes standard sizes like A4, Letter, Legal, and others. You can select any of these based on your printing needs.

Is it possible to print documents asynchronously with IronPrint?

Yes, IronPrint provides the `Printer.PrintAsync` method to print documents asynchronously, allowing for non-blocking operations, essential for applications like WPF or WinForms.

Which property controls the paper size when printing with IronPrint?

The `PaperSize` property within the `PrintSettings` class controls the paper size when using IronPrint.

Does IronPrint allow customization of printing settings beyond paper size?

Yes, IronPrint allows further customization of printing settings including orientation, DPI, margins, copy count, and grayscale mode through the `PrintSettings` class.

How does IronPrint handle cases where no paper size is specified?

If no `PaperSize` is specified in the `PrintSettings`, IronPrint defaults to `PaperSize.PrinterDefault`, which uses the paper size configured in the operating system's default printer.

What happens if I want to respect end-user printer preferences in IronPrint?

Using `PaperSize.PrinterDefault` allows IronPrint to respect end-user printer preferences, as it uses the size set in the default printer configuration.

How do I install IronPrint for use in a C# project?

You can install IronPrint via NuGet with the command `Install-Package IronPrint`, and then include `using IronPrint;` in your C# files to access its functionalities.

What are some paper sizes supported by IronPrint?

IronPrint supports several paper sizes including ISO standards like A0, A1, A2, A3, A4, A5, and common US sizes like Letter, Legal, and Executive.

How can I access the full API reference for IronPrint?

The full API reference for IronPrint can be accessed through their documentation at the IronSoftware website, providing detailed information on classes and methods.

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.
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