How to Set Paper Orientation for Printing in C#

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

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

    using IronPrint;
    
    // Print a document in landscape orientation
    Printer.Print("report.pdf", new PrintSettings
    {
        PaperOrientation = PaperOrientation.Landscape
    });
  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 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.

:path=/static-assets/print/content-code-examples/how-to/set-paper-orientation/set-paper-orientation-portrait-and-landscape-orientation.cs
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);
Imports IronPrint

' Configure portrait orientation
Dim portraitSettings As New PrintSettings With {
    .PaperOrientation = PaperOrientation.Portrait
}

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

' Configure landscape orientation
Dim landscapeSettings As New PrintSettings With {
    .PaperOrientation = PaperOrientation.Landscape
}

' Print the dashboard in landscape
Printer.Print("quarterly-dashboard.pdf", landscapeSettings)
$vbLabelText   $csharpLabel

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.

:path=/static-assets/print/content-code-examples/how-to/set-paper-orientation/set-paper-orientation-combine-orientation-with-settings.cs
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);
Imports IronPrint

' Combine orientation with paper size, DPI, and margins
Dim settings As New PrintSettings With {
    .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)
$vbLabelText   $csharpLabel

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.

:path=/static-assets/print/content-code-examples/how-to/set-paper-orientation/set-paper-orientation-dialog-with-orientation-preset.cs
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);
Imports IronPrint

' Pre-configure landscape orientation for the dialog
Dim settings As New PrintSettings With {
    .PaperOrientation = PaperOrientation.Landscape,
    .PaperSize = PaperSize.Letter
}

' Open the dialog with pre-selected orientation
Printer.ShowPrintDialog("wide-report.pdf", settings)
$vbLabelText   $csharpLabel

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 paper orientation for printing in C#?

To set paper orientation for printing in C#, you can use IronPrint's PaperOrientation property. This allows you to specify whether you want the document printed in portrait, landscape, or an automatic orientation.

What options are available for paper orientation in IronPrint?

IronPrint provides options for setting the paper orientation to portrait, landscape, or automatic, giving you full control over how your documents are printed.

Is it possible to automatically determine paper orientation in IronPrint?

Yes, IronPrint can automatically determine the best paper orientation for your document using its automatic orientation setting.

What property is used to control paper orientation in IronPrint?

The PaperOrientation property in IronPrint is used to control the paper orientation for printing documents in C#.

Can IronPrint handle landscape printing?

Yes, IronPrint can handle landscape printing by setting the PaperOrientation property to landscape.

Does IronPrint support portrait mode for document printing?

IronPrint fully supports portrait mode for document printing by setting the PaperOrientation property to portrait.

How do I achieve full control over paper orientation in C# using IronPrint?

You can achieve full control over paper orientation by utilizing the PaperOrientation property in IronPrint to specify portrait, landscape, or automatic modes.

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 40,390 | Version: 2026.5 just released
Still Scrolling Icon

Still Scrolling?

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