Back to Devexpress

DocumentLayout.GetPageCount() Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-layout-dot-documentlayout-712eecfb.md

latest4.9 KB
Original Source

DocumentLayout.GetPageCount() Method

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

Declaration

csharp
public int GetPageCount()
vb
Public Function GetPageCount As Integer

Returns

TypeDescription
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

csharp
for (int i = 0; i < richEdit.DocumentLayout.GetPageCount(); i++)
{

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

csharp
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

csharp
// 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

csharp
var documentLayout = rtfProcessor.DocumentLayout;
int pageCount = documentLayout.GetPageCount();
return pageCount;

office-file-api-in-web-api-app/CS/Controllers/RichEditController.cs#L88

csharp
}
int pageCount = server.DocumentLayout.GetPageCount();
using (ZipArchive archive = new ZipArchive())

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

vb
For i As Integer = 0 To richEdit.DocumentLayout.GetPageCount() - 1
    visitor.Reset()

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

vb
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

vb
' 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

vb
Dim documentLayout = rtfProcessor.DocumentLayout
Dim pageCount As Integer = documentLayout.GetPageCount()
Return pageCount

See Also

DocumentLayout Class

DocumentLayout Members

DevExpress.XtraRichEdit.API.Layout Namespace