Represents a page numbering label page element.
For a list of all members of this type, see PageNumberingLabel members.
![]() ![]() ![]() ![]()
|
System.Object
ceTe.DynamicPDF.PageElement
ceTe.DynamicPDF.PageElements.RotatingPageElement
ceTe.DynamicPDF.PageElements.PageNumberingLabel
[Visual Basic]
Public Class PageNumberingLabel
Inherits RotatingPageElement
Implements IArea, ICoordinate [C#]
public class PageNumberingLabel : RotatingPageElement, IArea, ICoordinate This class can be used to add page and section numbering to a PDF document. A document can be broken up into sections using the Sections property of the Document class. The following tokens can be used within the text of a PageNumberingLabel. They will be replaced with the appropriate value when the PDF is output.
| Token | Description |
|---|---|
| CP | Current page. The default numbering style is numeric. The current page can be offset using the is offset by the PageOffset property. |
| TP | Total pages. The default numbering style is numeric. The total pages can be offset using the is offset by the PageTotalOffset property. |
| SP | Section page. The default numbering style is the numbering style used by the section. The total pages can be offset using the is offset by the PageTotalOffset property. |
| ST | Section Total. The default numbering style is the numbering style used by the section. The total pages can be offset using the is offset by the PageTotalOffset property. |
| PR | Prefix. The sections prefix. |
| Numbering Style | Description |
|---|---|
| 1 | Numeric. Arabic numbers are used: 1, 2, 3, etc. Example: "%%CP(1)%%" |
| i | Lower Case Roman Numerals. Lower case roman numerals are used: i, ii, iii, etc. Example: "%%CP(i)%%". |
| I | Upper Case Roman Numerals. Upper case roman numerals are used: I, II, III, etc. Example: "%%CP(I)%%". |
| a | Lower Latin Letters. Lower case Latin letters are used: a, b, c, etc. After z, aa is used followed by bb, cc, etc. Example: "%%CP(a)%%". |
| A | Upper Latin Letters. Upper case Latin letters are used: A, B, C, etc. After Z, AA is used followed by BB, CC, etc. Example: "%%CP(A)%%". |
| b | Lower Latin Letters. Lower case Latin letters are used: a, b, c, etc. After z, aa is used followed by ab, ac, etc. Example: "%%CP(b)%%". |
| B | Lower Latin Letters. Lower case Latin letters are used: A, B, C, etc. After Z, AA is used followed by AB, AC, etc. Example: "%%CP(B)%%". |
The following example shows how to use page numbering in a document.
[Visual Basic]
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
' Create a document template and add it to the document
Dim documentTemplate As Template = New Template()
MyDocument.Template = documentTemplate
' Place a page numbering label in the document template
documentTemplate.Elements.Add( New PageNumberingLabel( _
"%%PR%%%%SP%% of %%ST%%", 0, 680, 512, 12, Font.Helvetica, _
12, TextAlign.Center ) )
' Begin the first section
MyDocument.Sections.Begin( NumberingStyle.RomanLowerCase )
' Add three pages
MyDocument.Pages.Add( new Page() ) 'Page 1
MyDocument.Pages.Add( new Page() ) 'Page 2
MyDocument.Pages.Add( new Page() ) 'Page 3
' Begin the second section
MyDocument.Sections.Begin( NumberingStyle.Numeric )
' Add four pages
MyDocument.Pages.Add( new Page() ) 'Page 4
MyDocument.Pages.Add( new Page() ) 'page 5
MyDocument.Pages.Add( new Page() ) 'page 6
MyDocument.Pages.Add( new Page() ) 'page 7
' Begin the third section specifying a section prefix
MyDocument.Sections.Begin( NumberingStyle.RomanLowerCase, _
"Appendix A - " )
' Add two pages
MyDocument.Pages.Add( new Page() ) 'page 8
MyDocument.Pages.Add( new Page() ) 'page 9
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
[C#]
using System; |
This class is a DynamicPDF Generator Community Edition feature.
Namespace: ceTe.DynamicPDF.PageElements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Assembly: ceTe.DynamicPDF (in ceTe.DynamicPDF.dll)
PageNumberingLabel Members | ceTe.DynamicPDF.PageElements Namespace
© Copyright 2007, ceTe Software