IRONSOFTWAREHOME

How to Set Paper Orientation for Printing in C#

Curtis Chau
Curtis Chau
Updated: August 2, 2026

Paper orientation controls whether a document prints in portrait (tall) or landscape (wide) mode. Portrait works for most letters, invoices, and reports. Landscape is the better choice for wide tables, spreadsheets, dashboards, and presentation slides. Setting orientation programmatically ensures consistent output regardless of the user's default printer configuration.

IronPrint exposes a PaperOrientation property on the PrintSettings class. We set it to Portrait or Landscape, pass the settings to Printer.Print(), and the document prints in the specified layout.

Quickstart: Set Paper Orientation
  1. Install IronPrint via NuGet: Install-Package IronPrint
  2. Add using IronPrint; to the file
  3. Create a PrintSettings object
  4. Set PaperOrientation to Portrait or Landscape
  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 a document in landscape orientation
    Printer.Print("report.pdf", new PrintSettings
    {
        PaperOrientation = PaperOrientation.Landscape
    });
    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 Orientation for Printing?

The PaperOrientation property on PrintSettings accepts three values:

  • PaperOrientation.Portrait - vertical layout (default on most printers). Best for single-column documents like letters, contracts, and invoices.
  • PaperOrientation.Landscape - horizontal layout. Best for wide content like data tables, Gantt charts, spreadsheets, and slide decks.
  • PaperOrientation.Automatic - defers to the printer's default setting.

We create a PrintSettings object, assign the desired orientation, and pass it to Printer.Print() for silent printing or Printer.ShowPrintDialog() for dialog-based printing.

using IronPrint;

// Configure portrait orientation
var portraitSettings = new PrintSettings
{
    PaperOrientation = PaperOrientation.Portrait
};

// Print the invoice in portrait
Printer.Print("invoice.pdf", portraitSettings);

// Configure landscape orientation
var landscapeSettings = new PrintSettings
{
    PaperOrientation = PaperOrientation.Landscape
};

// Print the dashboard in landscape
Printer.Print("quarterly-dashboard.pdf", landscapeSettings);

With the native .NET System.Drawing.Printing approach, orientation is a boolean (DefaultPageSettings.Landscape = true) buried inside a PrintDocument that also requires PrintPage event handling, graphics rendering, and manual page management. IronPrint replaces that entire pipeline with a single property on a settings object.

How Do I Combine Orientation with Other Print Settings?

Orientation is most useful when combined with paper size, DPI, and margins to define a complete print layout. The PrintSettings class lets us configure all of these in one object.

using IronPrint;

// Combine orientation with paper size, DPI, and margins
var settings = new PrintSettings
{
    PaperOrientation = PaperOrientation.Landscape,
    PaperSize = PaperSize.A4,
    Dpi = 300,
    NumberOfCopies = 1,
    PaperMargins = new Margins(15, 15, 15, 15),
    Grayscale = false
};

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

PaperSize and PaperOrientation work together - setting A4 landscape gives a 297 × 210 mm print area, while A4 portrait gives 210 × 297 mm. The Dpi property controls output resolution (300 is standard for business documents), and PaperMargins values are in millimeters.

How Do I Let Users Choose Orientation in the Print Dialog?

When we pass PrintSettings to Printer.ShowPrintDialog(), the dialog opens with our preset orientation. The user can accept it or switch between portrait and landscape before printing.

using IronPrint;

// Pre-configure landscape orientation for the dialog
var settings = new PrintSettings
{
    PaperOrientation = PaperOrientation.Landscape,
    PaperSize = PaperSize.Letter
};

// Open the dialog with pre-selected orientation
Printer.ShowPrintDialog("wide-report.pdf", settings);

For non-blocking UI scenarios, the async variant Printer.ShowPrintDialogAsync() accepts the same parameters and keeps the application responsive while the dialog is open. This is especially useful for orientation because users often want to preview how a document looks in portrait versus landscape before committing to a print run. The print document tutorial covers both silent and dialog workflows end to end.

Next Steps

Paper orientation is one property on the PrintSettings object - set PaperOrientation to Portrait, Landscape, or Automatic and pass it to any IronPrint print method. Combine it with PaperSize, Dpi, and PaperMargins for full layout control.

Explore the print settings how-to for every available property, the Printer class API reference for the complete method surface, or the code examples page for ready-to-run snippets. The IronPrint tutorials walk through the full printing lifecycle, and the changelog tracks recent updates including performance improvements.

Start a free 30-day trial to test orientation settings in a live project. When ready, view licensing options starting at $999.

Frequently Asked Questions

How can I set the paper orientation for printing in C#?

To set the paper orientation in C# using IronPrint, use the `PaperOrientation` property on the `PrintSettings` class. You can set it to `Portrait` for vertical layout or `Landscape` for horizontal layout. Pass these settings to `Printer.Print()` to ensure documents print in the specified orientation.

What are the available paper orientation options in IronPrint?

IronPrint provides three `PaperOrientation` options: `Portrait`, `Landscape`, and `Automatic`. `Portrait` is best for vertical documents like letters, while `Landscape` is ideal for horizontal content like spreadsheets. `Automatic` defers to the printer's default orientation setting.

Can I modify other print settings alongside paper orientation?

Yes, IronPrint allows you to combine orientation with other settings such as paper size, DPI, and margins by configuring them within the same `PrintSettings` object. This ensures full control over the print layout.

Is it possible to let users choose their preferred orientation through a print dialog?

Yes, by using `Printer.ShowPrintDialog()` with a pre-configured `PrintSettings` object, users are presented with a dialog where they can select between portrait and landscape orientations.

How do I install IronPrint to manage paper orientation in my project?

To install IronPrint, use NuGet with the command `Install-Package IronPrint`. This adds the necessary library to your project, allowing you to control paper orientation and other print settings.

What makes IronPrint's approach to setting paper orientation different from .NET's native System.Drawing.Printing?

IronPrint simplifies the process by replacing complex native methods like handling `PrintPage` events and managing page layouts, with the `PaperOrientation` property in its `PrintSettings` object, providing an easier and more efficient way to set orientation.

How do I start a trial for IronPrint to test orientation settings?

You can start a free 30-day trial of IronPrint by visiting their website. This allows you to explore and test different orientation settings and other features within a live project before committing to a purchase.

Does IronPrint support async operations for user interaction in print dialogs?

Yes, IronPrint supports asynchronous operations through `Printer.ShowPrintDialogAsync()`, allowing the application to remain responsive while the print dialog is open, which is useful for scenarios where users need to preview document orientation options.

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