VegaRise.NET
Back to DOM

PageNumberClass

Definition

Namespace
DOM.Elements
Assembly
DOM.dll

Represents a page number element in the Vega DOM, allowing for the inclusion of page numbers in documents.

Remarks

extends (which centralizes number formatting options such as chapter separators, numeric format, and starting page number) with the placement and odd/even behaviour specific to a page number field. PageNumber PageNumberType Page numbers are typically rendered inside a header or footer. Assigning a to a section or a header/footer part allows the layout engine to compute and render the correct number for each page, honoring different alignments for odd and even pages when is . PageNumber DifferentOddEven true

Examples

csharp
1// 1. Right-aligned, starting at 1
2var pn = new PageNumber
3{
4 Alignment = HorizontalAlignmentValues.right,
5 NumberFormat = NumberFormatValues.Decimal,
6 StartingPageNumber = 1
7};
8var section = doc.AddSection();
9section.PageNumber = pn;
10
csharp
1// 2. Odd/even mirrored page numbers
2var pn = new PageNumber
3{
4 DifferentOddEven = true,
5 Alignment = HorizontalAlignmentValues.Outside,
6 NumberFormat = NumberFormatValues.Decimal
7};
8
csharp
1// 3. Include chapter number with hyphen separator
2var pn = new PageNumber
3{
4 IncludeChapterNumber = true,
5 ChapterHeadingLevel = 1,
6 ChapterSeparator = ChapterSeparatorValues.hyphen,
7 NumberFormat = NumberFormatValues.Decimal
8};
9
csharp
1// 4. Roman numerals for front matter
2var pn = new PageNumber
3{
4 NumberFormat = NumberFormatValues.lowerRoman,
5 StartingPageNumber = 1,
6 Alignment = HorizontalAlignmentValues.Center
7};
8

Properties

Gets or sets the alignment of the page number on the page (e.g., left, center, right).

DifferentOddEven

Gets or sets a value indicating whether the page number should be different for odd and even pages.

VegaRise.NET

Sign In

Welcome back. Please sign in to your account.

Forgot password?
or

Don't have an account? Create an account

By signing in, you agree to our Terms of Service and Privacy Policy.