officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-layout-dot-documentlayout-712eecfb.md
Get a number of pages in the document.
Namespace : DevExpress.XtraRichEdit.API.Layout
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
public int GetPageCount()
Public Function GetPageCount As Integer
| Type | Description |
|---|---|
| Int32 |
The Int32 value that is the page count.
|
The following code snippets (auto-collected from DevExpress Examples) contain references to the GetPageCount() 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#L60
for (int i = 0; i < richEdit.DocumentLayout.GetPageCount(); i++)
{
winforms-richedit-layout-api/CS/Form1.cs#L103
srv.Document.AppendDocumentContent(richEditControl1.Document.Selection);
int pageCount = srv.DocumentLayout.GetPageCount();
MessageBox.Show(String.Format("Selected range will occupy {0} page(s)", pageCount));
word-document-api-examples/CS/CodeExamples/BasicActions.cs#L47
// Obtain a number of pages in the document.
int pageCount = wordProcessor.DocumentLayout.GetPageCount();
word-document-api-use-layout-api-to-manage-document-pages/CS/Program.cs#L38
var documentLayout = rtfProcessor.DocumentLayout;
int pageCount = documentLayout.GetPageCount();
return pageCount;
office-file-api-in-web-api-app/CS/Controllers/RichEditController.cs#L88
}
int pageCount = server.DocumentLayout.GetPageCount();
using (ZipArchive archive = new ZipArchive())
winforms-richedit-emulate-the-ms-word-status-bar/VB/WindowsFormsApplication1/Form1.vb#L50
For i As Integer = 0 To richEdit.DocumentLayout.GetPageCount() - 1
visitor.Reset()
winforms-richedit-layout-api/VB/Form1.vb#L85
srv.Document.AppendDocumentContent(richEditControl1.Document.Selection)
Dim pageCount As Integer = srv.DocumentLayout.GetPageCount()
MessageBox.Show(String.Format("Selected range will occupy {0} page(s)", pageCount))
word-document-api-examples/VB/CodeExamples/BasicActions.vb#L49
' Obtain a number of pages in the document.
Dim pageCount As Integer = wordProcessor.DocumentLayout.GetPageCount()
' Check all pages in the document.
word-document-api-use-layout-api-to-manage-document-pages/VB/Program.vb#L28
Dim documentLayout = rtfProcessor.DocumentLayout
Dim pageCount As Integer = documentLayout.GetPageCount()
Return pageCount
See Also