PageNumberingLabel

Use the PageNumberingLabel element to add page numbering to a PDF document.

Refer to PageNumberingLabel layout element for a Github example. Also refer to the SoftBreak and NoSplitZone task example for an example illustrating using this element.

To add a PageNumberingLabel, right-click and select Add Page Numbering Label from the context menu.

Figure 1. Adding a PageNumberingLabel layout element using the context menu.

Tokens

Use, the following tokens within the text of a PageNumberingLabel. The tokens will be replaced with the appropriate value when the PDF is created. Surround Page Numbering Label elements with the %% character. Examples are provided below.

Token Example Description
CP %%CP%% Current page. The default numbering style is numeric. The current page can be offset using the is offset by the page property.
TP %%TP%% Total pages. The default numbering style is numeric. The total pages can be offset using the is offset by the pageTotalOffset property.

All tokens can also contain a numbering style specifier. The numbering style specifier is placed in parenthesis after the token. If no numbering style specifier is given, then the current numbering specifier is used.

Figure 2. Adding a PageNumberingLabel layout element that specifies page and total pages.

Numbering Styles

Add numbering styles by placing the numbering style in parenthesis after the token. For example, %%CP(I)%% would output an upper-case roman numeral.

Figure 3. Different ways to format page numbering.

Numbering Style Description
1 Numeric. Arabic numbers are used: 1, 2, 3, etc.
i Lower Case Roman Numerals. Lower case roman numerals are used: i, ii, iii, etc.
I Upper Case Roman Numerals. Upper case roman numerals are used: I, II, III, etc.
a Lower Latin Letters. Lower case Latin letters are used: a, b, c, etc. After z, aa is used followed by bb, cc, etc.
A Upper Latin Letters. Upper case Latin letters are used: A, B, C, etc. After Z, AA is used followed by BB, CC, etc.
b Lower Latin Letters. Lower case Latin letters are used: a, b, c, etc. After z, aa is used followed by ab, ac, etc.
B Lower Latin Letters. Lower case Latin letters are used: A, B, C, etc. After Z, AA is used followed by AB, AC, etc.

If you have a cover page, and you do not add the label to the cover page, then the report by default starts at page number 2. To start at page one, set the pageNumberingOffset to -1. Then the first page of the report will be 1 rather than 2.

Properties

The PageNumberingLabel element has the following properties.

Property Value Description
align center, justify, fullJustify, right, left A value indicating the alignment of the PageNumberingLabel.
font See fonts UsersGuide. A value indicating the font to be used for the PageNumberingLabel.
fontSize numeric A value indicating the font size of the PageNumberingLabel.
pageOffset numeric A value indicating the page offset for PageNumberingLabel.
pageTotalOffset numeric A value indicating the page total offset for PageNumberingLabel.
text text A value indicating the text of the PageNumberingLabel.
textColor See Colors Users Guide topic. A value indicating the text color of the PageNumberingLabel.
underline true, false A value indicating whether to underline the PageNumberingLabel.
vAlign bottom, center, top A value indicating the vertical alignment of the PageNumberingLabel.
id text A value indicating the programmatic identifier of the PageNumberingLabel.
angle numeric A value indicating the number of degrees to rotate the PageNumberingLabel.
height numeric A value indicating the height of the PageNumberingLabel.
width numeric A value indicating the width of the PageNumberingLabel.
x numeric A value indicating the X coordinate of the PageNumberingLabel.
y numeric A value indicating the Y coordinate of the PageNumberingLabel.

In this topic