officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-sectionpage-8bf5ab91.md
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
bool Landscape { get; set; }
Property Landscape As Boolean
| Type | Description |
|---|---|
| Boolean |
true , if the page’s orientation is landscape; false , if the page has the standard portrait orientation.
|
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.
if(section.Page.Width < section.Page.Height)
{
section.Page.Landscape = true;
}
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
_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
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
_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
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
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
_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
' 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
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
_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
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