Package com.dynamicpdf.api.elements
Class PageNumberingElement
java.lang.Object
com.dynamicpdf.api.elements.Element
com.dynamicpdf.api.elements.PageNumberingElement
Represents a page numbering label page element.
 
 
 
 
All tokens except the %%PR%% token can also contain a numbering style specifier. The numbering style specifier is placed in parenthesis after the token.
 
 
 
This class can be used to add page numbering to a PDF document. 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. | 
| TP | Total pages. The default numbering style is numeric. | 
| SP | Section page. | 
| ST | Section Total. | 
| PR | Prefix. | 
All tokens except the %%PR%% token can also contain a numbering style specifier. The numbering style specifier is placed in parenthesis after the token.
| 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, ect. 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, ect. 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, ect. 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, ect. Example: "%%CP(B)%%". | 
There should be no spaces within a token, only the token and optional numbering style specifier. This token is invalid %%CP ( i )%% because of the extra spaces.
Here are some examples of valid tokens:- %%SP%%
 - %%SP(I)%%
 - %%PR%%
 - %%ST(B)%%
 
- 
Constructor Summary
ConstructorsConstructorDescriptionPageNumberingElement(String text, ElementPlacement placement)Initializes a new instance of thePageNumberingElementclass.PageNumberingElement(String text, ElementPlacement placement, float xOffset, float yOffset)Initializes a new instance of thePageNumberingElementclass. - 
Method Summary
Modifier and TypeMethodDescriptiongetColor()Gets theColorobject to use for the text of the labelgetFont()Gets theFontobject to use for the text of the label.floatGets the font size for the text of the label.getText()Gets the text to display in the label.voidSets theColorobject to use for the text of the labelvoidSets theFontobject to use for the text of the label.voidsetFontSize(float value)Sets the font size for the text of the label.voidSets the text to display in the label.Methods inherited from class com.dynamicpdf.api.elements.Element
getEvenPages, getOddPages, getPlacement, getXOffset, getYOffset, setEvenPages, setOddPages, setPlacement, setXOffset, setYOffset 
- 
Constructor Details
- 
PageNumberingElement
Initializes a new instance of thePageNumberingElementclass.- Parameters:
 text- Text to display in the label.placement- The placement of the page numbering element on the page.xOffset- X coordinate of the label.yOffset- Y coordinate of the label.
 - 
PageNumberingElement
Initializes a new instance of thePageNumberingElementclass.- Parameters:
 text- Text to display in the label.placement- The placement of the page numbering element on the page.
 
 - 
 - 
Method Details
- 
getResource
- Overrides:
 getResourcein classElement
 - 
getTextFont
- Overrides:
 getTextFontin classElement
 - 
getColor
Gets theColorobject to use for the text of the label- Returns:
 - The 
Colorobject to use for the text of the label 
 - 
setColor
Sets theColorobject to use for the text of the label- Parameters:
 value- TheColorobject to use for the text of the label
 - 
getFont
Gets theFontobject to use for the text of the label.- Returns:
 - The 
Fontobject to use for the text of the label. 
 - 
setFont
Sets theFontobject to use for the text of the label.- Parameters:
 value- TheFontobject to use for the text of the label.
 - 
getFontSize
public float getFontSize()Gets the font size for the text of the label.- Returns:
 - The font size for the text of the label.
 
 - 
setFontSize
public void setFontSize(float value)Sets the font size for the text of the label.- Parameters:
 value- The font size for the text of the label.
 - 
getText
Gets the text to display in the label.- Returns:
 - The text to display in the label.
 
 - 
setText
Sets the text to display in the label.- Parameters:
 value- The text to display in the label.
 
 -