Back to DOM
PageClass
Definition
- Namespace
- DOM.Elements
- Assembly
- DOM.dll
Represents a single page within a document section.
Remarks
A is an that reflects a rendered page in the document layout. Pages are generated automatically by the layout engine based on the section's content flow and settings; consumers typically inspect them rather than create them directly. Page ElementsContainer Page-level content (paragraphs, images, shapes, tables, text, paths) is available through the inherited container APIs.
Examples
csharp
1// 1. Iterate all pages of the document
2foreach (var page in doc.Pages)
3{
4 Console.WriteLine($"Page {page.PageNumber}");
5}
6
csharp
1// 2. Access pages within a specific section
2var section = doc.Sections.First();
3var pages = section.Pages;
4
csharp
1// 3. Read paragraphs from the first page
2var firstPage = doc.Pages.First();
3foreach (var p in firstPage.Paragraphs) { /* ... */ }
4
csharp
1// 4. Determine the number of pages in the document
2int pageCount = doc.Pages.Count;
3
Properties
PageNumber
Gets or sets the page number.