This documentation is archived and is not being maintained.

PageSettings.Landscape Property

Gets or sets a value indicating whether the page is printed in landscape or portrait orientation.

Namespace:  System.Drawing.Printing
Assembly:  System.Drawing (in System.Drawing.dll)

public bool Landscape { get; set; }

Property Value

Type: System.Boolean
true if the page should be printed in landscape orientation; otherwise, false. The default is determined by the printer.


The printer named in the PrinterSettings.PrinterName property does not exist.

You can use the PrinterSettings.LandscapeAngle property to determine the angle, in degrees, that the portrait orientation is rotated to produce the landscape orientation.

The following code example sets a document's default page orientation to landscape through the PrintDocument.DefaultPageSettings property, and prints the document. The example has three prerequisites:

  • A variable named filePath has been set to the path of the file to print.

  • A method named pd_PrintPage, which handles the PrintPage event, has been defined.

  • A variable named printer has been set to the printer's name.

Use the System.Drawing, System.Drawing.Printing, and System.IO namespaces for this example.

public void Printing() {
   try {
     streamToPrint = new StreamReader (filePath);
     try {
       printFont = new Font("Arial", 10);
       PrintDocument pd = new PrintDocument(); 
       pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
       pd.PrinterSettings.PrinterName = printer;
       // Set the page orientation to landscape.
       pd.DefaultPageSettings.Landscape = true;
     finally {
       streamToPrint.Close() ;
   catch(Exception ex) { 

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.