How to Set Paper Size for Printing in C#

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. Install IronPrint with NuGet Package Manager

    PM > Install-Package IronPrint
  2. Copy and run this code snippet.

    using IronPrint;
    
    // Print a PDF on A4 paper
    Printer.Print("report.pdf", new PrintSettings
    {
        PaperSize = PaperSize.A4
    });
  3. Deploy 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.

:path=/static-assets/print/content-code-examples/how-to/set-paper-size/set-paper-size.cs
using IronPrint;

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

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

' Configure print settings with US Letter paper
Dim settings As New PrintSettings()
settings.PaperSize = PaperSize.Letter

' Send the document to the default printer
Printer.Print("invoice.pdf", settings)
$vbLabelText   $csharpLabel

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 Value Standard Dimensions (mm) Dimensions (in)
PaperSize.A0 ISO A0 841 × 1189 33.1 × 46.8
PaperSize.A1 ISO A1 594 × 841 23.4 × 33.1
PaperSize.A2 ISO A2 420 × 594 16.5 × 23.4
PaperSize.A3 ISO A3 297 × 420 11.7 × 16.5
PaperSize.A4 ISO A4 210 × 297 8.3 × 11.7
PaperSize.A5 ISO A5 148 × 210 5.8 × 8.3
PaperSize.B4 ISO B4 250 × 353 9.8 × 13.9
PaperSize.B5 ISO B5 176 × 250 6.9 × 9.8
PaperSize.Letter US Letter 216 × 279 8.5 × 11.0
PaperSize.Legal US Legal 216 × 356 8.5 × 14.0
PaperSize.Executive US Executive 184 × 267 7.25 × 10.5
PaperSize.PrinterDefault Printer default Varies Varies

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.

:path=/static-assets/print/content-code-examples/how-to/set-paper-size/combined-settings.cs
using IronPrint;

// Build a fully configured print job
PrintSettings settings = new PrintSettings
{
    PaperSize = PaperSize.A4,
    PaperOrientation = PaperOrientation.Landscape,
    Dpi = 300,
    NumberOfCopies = 3,
    PaperMargins = new Margins(15, 15, 15, 15),
    Grayscale = false
};

// Print a multi-page report with these settings
Printer.Print("quarterly-report.pdf", settings);
Imports IronPrint

' Build a fully configured print job
Dim settings As New PrintSettings With {
    .PaperSize = PaperSize.A4,
    .PaperOrientation = PaperOrientation.Landscape,
    .Dpi = 300,
    .NumberOfCopies = 3,
    .PaperMargins = New Margins(15, 15, 15, 15),
    .Grayscale = False
}

' Print a multi-page report with these settings
Printer.Print("quarterly-report.pdf", settings)
$vbLabelText   $csharpLabel

We use object initializer syntax here for clarity. PaperOrientation.Landscape rotates the A4 sheet to its wider axis. Dpi at 300 ensures sharp output for charts and fine text. PaperMargins accepts four values in millimeters — top, right, bottom, left — through the Margins constructor. The Grayscale property defaults to false, 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.

:path=/static-assets/print/content-code-examples/how-to/set-paper-size/async-print.cs
using IronPrint;
using System.Threading.Tasks;

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

        // Print without blocking the UI thread
        await Printer.PrintAsync(filePath, settings);
    }
}
Imports IronPrint
Imports System.Threading.Tasks

Public Class DocumentPrinter
    Public Async Function PrintLegalDocumentAsync(filePath As String) As Task
        ' Configure Legal paper size for contracts and legal documents
        Dim settings As New PrintSettings With {
            .PaperSize = PaperSize.Legal,
            .PaperOrientation = PaperOrientation.Portrait,
            .Dpi = 300
        }

        ' Print without blocking the UI thread
        Await Printer.PrintAsync(filePath, settings)
    End Function
End Class
$vbLabelText   $csharpLabel

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.

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 37,845 | Version: 2026.3 just released
Still Scrolling Icon

Still Scrolling?

Want proof fast? PM > Install-Package IronPrint
run a sample watch your document hit the printer.