Back to Devexpress

DocumentLayout.GetPage(Int32) Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-layout-dot-documentlayout-dot-getpage-x28-system-dot-int32-x29.md

latest6.6 KB
Original Source

DocumentLayout.GetPage(Int32) Method

Gets the page of the document layout by the specified index.

Namespace : DevExpress.XtraRichEdit.API.Layout

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
public LayoutPage GetPage(
    int pageIndex
)
vb
Public Function GetPage(
    pageIndex As Integer
) As LayoutPage

Parameters

NameTypeDescription
pageIndexInt32

An integer that is the index of a requested page.

|

Returns

TypeDescription
LayoutPage

A LayoutPage object that is the page of the document layout.

|

Remarks

If the document layout is ready and up-to-date, the GetPage method returns the page with the specified index. Otherwise, the document layout is calculated from the beginning, creating pages until a page with the specified index is ready. The DocumentLayout.PageFormatted and DocumentLayout.DocumentFormatted events may occur in this situation.

The following code snippets (auto-collected from DevExpress Examples) contain references to the GetPage(Int32) method.

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.

winforms-richedit-emulate-the-ms-word-status-bar/CS/WindowsFormsApplication1/Form1.cs#L41

csharp
visitor.Reset();
    visitor.Visit(richEditControl1.DocumentLayout.GetPage(list[i].PageIndex));
}

winforms-richedit-layout-api-practical-usage/CS/WindowsFormsApplication1/DocumentLayoutHelper/RichEditDocumentLayoutAnalyzer.cs#L27

csharp
int currentPageIndex = currentDocumentLayout.GetPageIndex(layoutPosition);
    returnedInformation += PageLayoutHelper.GetInformationAboutCurrentPage(currentDocumentLayout, currentDocumentLayout.GetPage(currentPageIndex), docPosition);
}

winforms-richedit-layout-api/CS/Form1.cs#L29

csharp
MyDocumentLayoutVisitor visitor = new MyDocumentLayoutVisitor();
    visitor.Visit(richEditControl1.DocumentLayout.GetPage(i));
}

winforms-richedit-enable-line-numbering-and-count-document-rows/CS/LineNumberingExample/Form1.cs#L79

csharp
for (int i = 0; i < pageCount; i++) {
    visitor.Visit(richEditControl1.DocumentLayout.GetPage(i));
}

word-document-api-examples/CS/CodeExamples/BasicActions.cs#L53

csharp
// Access the document page.
DevExpress.XtraRichEdit.API.Layout.LayoutPage layoutPage = wordProcessor.DocumentLayout.GetPage(i);

winforms-richedit-emulate-the-ms-word-status-bar/VB/WindowsFormsApplication1/Form1.vb#L34

vb
visitor.Reset()
    visitor.Visit(richEditControl1.DocumentLayout.GetPage(list(i).PageIndex))
Next i

winforms-richedit-layout-api-practical-usage/VB/WindowsFormsApplication1/DocumentLayoutHelper/RichEditDocumentLayoutAnalyzer.vb#L32

vb
Dim currentPageIndex As Integer = currentDocumentLayout.GetPageIndex(layoutPosition)
    returnedInformation &= PageLayoutHelper.GetInformationAboutCurrentPage(currentDocumentLayout, currentDocumentLayout.GetPage(currentPageIndex), docPosition)
End If

richedit-winforms-layout-element-under-cursor/VB/ToolTip/Form1.vb#L26

vb
Dim pageIndex As Integer = pageLayoutPosition.PageIndex
Dim layoutPage As LayoutPage = richEditControl1.DocumentLayout.GetPage(pageIndex)
'Create a HitTestManager instance:

winforms-richedit-layout-api/VB/Form1.vb#L24

vb
Dim visitor As New MyDocumentLayoutVisitor()
    visitor.Visit(richEditControl1.DocumentLayout.GetPage(i))
Next i

winforms-richedit-enable-line-numbering-and-count-document-rows/VB/LineNumberingExample/Form1.vb#L74

vb
For i As Integer = 0 To pageCount - 1
    visitor.Visit(richEditControl1.DocumentLayout.GetPage(i))
Next

See Also

DocumentLayout Class

DocumentLayout Members

DevExpress.XtraRichEdit.API.Layout Namespace