Back to Devexpress

SectionPage.Landscape Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-sectionpage-8bf5ab91.md

latest6.5 KB
Original Source

SectionPage.Landscape Property

Gets or sets a value that specifies whether the page’s orientation is landscape.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
bool Landscape { get; set; }
vb
Property Landscape As Boolean

Property Value

TypeDescription
Boolean

true , if the page’s orientation is landscape; false , if the page has the standard portrait orientation.

|

Remarks

When you set the Landscape property, the RichEditControl rotates this page so that its width becomes height and vice versa. Relative width and height values are not validated, therefore, a situation in which the page in landscape mode has a height greater than its width, is not uncommon. To prevent this from happening, check the page dimensions prior to switching page orientation, as illustrated below.

csharp
if(section.Page.Width < section.Page.Height)
    {
        section.Page.Landscape = true;
    }
vb
If section.Page.Width < section.Page.Height Then
        section.Page.Landscape = True
End If

The following code snippets (auto-collected from DevExpress Examples) contain references to the Landscape property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

word-document-api-print-documents/CS/Program.cs#L29

csharp
_section.Page.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A3;
_section.Page.Landscape = true;
_section.Margins.Left = 500f;

winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/PageLayout.cs#L44

csharp
document.Sections[0].Page.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A6;
document.Sections[0].Page.Landscape = true;
document.Sections[0].Margins.Left = 2.0f;

word-document-api-use-printablecomponentlink-to-print-document/CS/PrintingSystem/Form1.cs#L42

csharp
_section.Page.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A4;
_section.Page.Landscape = false;
_section.Margins.Left = 150f;

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/PageLayoutActions.cs#L44

csharp
document.Sections[0].Page.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A6;
document.Sections[0].Page.Landscape = true;
document.Sections[0].Margins.Left = 2.0f;

word-document-api-examples/CS/CodeExamples/PageLayoutActions.cs#L76

csharp
document.Sections[0].Page.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A6;
document.Sections[0].Page.Landscape = true;
document.Sections[0].Margins.Left = 2.0f;

word-document-api-print-documents/VB/Program.vb#L17

vb
_section.Page.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A3
_section.Page.Landscape = True
_section.Margins.Left = 500.0F

word-document-api-invoke-print-preview-dialog/VB/Form1.vb#L26

vb
' Specify page settings
richServer.Document.Sections(0).Page.Landscape = True
richServer.Document.Sections(0).Page.Height = DevExpress.Office.Utils.Units.InchesToDocumentsF(10.0F)

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/PageLayout.vb#L40

vb
document.Sections(CInt((0))).Page.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A6
document.Sections(CInt((0))).Page.Landscape = True
document.Sections(CInt((0))).Margins.Left = 2.0F

word-document-api-use-printablecomponentlink-to-print-document/VB/PrintingSystem/Form1.vb#L42

vb
_section.Page.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A4
_section.Page.Landscape = False
_section.Margins.Left = 150F

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/PageLayoutActions.vb#L33

vb
document.Sections(0).Page.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A6
document.Sections(0).Page.Landscape = True
document.Sections(0).Margins.Left = 2.0F

See Also

SectionPage Interface

SectionPage Members

DevExpress.XtraRichEdit.API.Native Namespace