|
DynamicPDF by ceTe Software | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cete.dynamicpdf.PageElement com.cete.dynamicpdf.pageelements.TaggablePageElement com.cete.dynamicpdf.pageelements.RotatingPageElement com.cete.dynamicpdf.pageelements.PageNumberingLabel
public class PageNumberingLabel
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, 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)%%
Licensing:
This class is a DynamicPDF Generator Community Edition feature.
Constructor Summary | |
---|---|
PageNumberingLabel(java.lang.String text,
float x,
float y,
float width,
float height)
Initializes a new instance of the PageNumberingLabel class. |
|
PageNumberingLabel(java.lang.String text,
float x,
float y,
float width,
float height,
Font font)
Initializes a new instance of the PageNumberingLabel class. |
|
PageNumberingLabel(java.lang.String text,
float x,
float y,
float width,
float height,
Font font,
float fontSize)
Initializes a new instance of the PageNumberingLabel class. |
|
PageNumberingLabel(java.lang.String text,
float x,
float y,
float width,
float height,
Font font,
float fontSize,
Color textColor)
Initializes a new instance of the PageNumberingLabel class. |
|
PageNumberingLabel(java.lang.String text,
float x,
float y,
float width,
float height,
Font font,
float fontSize,
TextAlign align)
Initializes a new instance of the PageNumberingLabel class. |
|
PageNumberingLabel(java.lang.String text,
float x,
float y,
float width,
float height,
Font font,
float fontSize,
TextAlign align,
Color textColor)
Initializes a new instance of the PageNumberingLabel class. |
Method Summary | |
---|---|
protected void |
drawRotated(PageWriter writer)
Draws the label to the given PageWriter object. |
TextAlign |
getAlign()
Gets the TextAlign enumeration that specifies the
text alignment of the label. |
Font |
getFont()
Gets the Font object to use for the text of the label. |
float |
getFontSize()
Gets the font size for the text of the label. |
int |
getNumberingLength()
Gets the length of the page numbering label. |
char |
getNumberingPaddingCharacter()
Gets the padding character of the page numbering label. |
int |
getPageOffset()
Gets the page offset for page numbering. |
int |
getPageTotalOffset()
Gets the page total offset for page numbering. |
java.lang.String |
getText()
Gets the text of the label. |
Color |
getTextColor()
Gets the Color object to use for the text of the label. |
boolean |
getUnderline()
Gets a value indicating if the label is underlined. |
VAlign |
getVAlign()
Gets the VAlign enumeration that specifies the vertical
text alignment of the label. |
float |
getWidth()
Gets the width of the label. |
void |
setAlign(TextAlign align)
Sets the TextAlign enumeration that specifies the
text alignment of the label. |
void |
setFont(Font font)
Sets the Font object to use for the text of the label. |
void |
setFontSize(float fontSize)
Sets the font size for the text of the label. |
void |
setNumberingLength(int numberingLength)
Sets the length of the page numbering label. |
void |
setNumberingPaddingCharacter(char paddingChar)
Sets the padding character of the page numbering label. |
void |
setPageOffset(int pageOffset)
Sets the page offset for page numbering. |
void |
setPageTotalOffset(int pageTotalOffset)
Sets the page total offset for page numbering. |
void |
setText(java.lang.String text)
Sets the text of the label. |
void |
setTextColor(Color textColor)
Sets the Color object to use for the text of the label. |
void |
setUnderline(boolean underline)
Sets a value indicating if the label is underlined. |
void |
setVAlign(VAlign vAlign)
Sets the VAlign enumeration that specifies the vertical
text alignment of the label. |
void |
setWidth(float width)
Sets the width of the label. |
Methods inherited from class com.cete.dynamicpdf.pageelements.RotatingPageElement |
---|
draw, getAngle, getHeight, getX, getY, setAngle, setHeight, setX, setY |
Methods inherited from class com.cete.dynamicpdf.pageelements.TaggablePageElement |
---|
getTag, getTagOrder, setTag, setTagOrder |
Methods inherited from class com.cete.dynamicpdf.PageElement |
---|
getRequiredLicenseLevel, getStrID, setRequiredLicenseLevel, setStrID |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.cete.dynamicpdf.pageelements.IArea |
---|
getHeight, setHeight |
Methods inherited from interface com.cete.dynamicpdf.pageelements.ICoordinate |
---|
getX, getY, setX, setY |
Constructor Detail |
---|
public PageNumberingLabel(java.lang.String text, float x, float y, float width, float height)
PageNumberingLabel
class.
text
- Text to display in the label.x
- X coordinate of the label.y
- Y coordinate of the label.width
- Width of the label.height
- Height of the label.public PageNumberingLabel(java.lang.String text, float x, float y, float width, float height, Font font)
PageNumberingLabel
class.
text
- Text to display in the label.x
- X coordinate of the label.y
- Y coordinate of the label.width
- Width of the label.height
- Height of the label.font
- Font
for the text of the label.Font
public PageNumberingLabel(java.lang.String text, float x, float y, float width, float height, Font font, float fontSize)
PageNumberingLabel
class.
text
- Text to display in the label.x
- X coordinate of the label.y
- Y coordinate of the label.width
- Width of the label.height
- Height of the label.font
- Font
for the text of the label.fontSize
- Font size of the text of the label.Font
public PageNumberingLabel(java.lang.String text, float x, float y, float width, float height, Font font, float fontSize, TextAlign align)
PageNumberingLabel
class.
text
- Text to display in the label.x
- X coordinate of the label.y
- Y coordinate of the label.width
- Width of the label.height
- Height of the label.font
- Font
for the text of the label.fontSize
- Font size of the text of the label.align
- Alignment of the text of the label.Font
,
TextAlign
public PageNumberingLabel(java.lang.String text, float x, float y, float width, float height, Font font, float fontSize, Color textColor)
PageNumberingLabel
class.
text
- Text to display in the label.x
- X coordinate of the label.y
- Y coordinate of the label.width
- Width of the label.height
- Height of the label.font
- Font
for the text of the label.fontSize
- Font size of the text of the label.textColor
- Color
of the text of the label.Font
,
Color
public PageNumberingLabel(java.lang.String text, float x, float y, float width, float height, Font font, float fontSize, TextAlign align, Color textColor)
PageNumberingLabel
class.
text
- Text to display in the label.x
- X coordinate of the label.y
- Y coordinate of the label.width
- Width of the label.height
- Height of the label.font
- Font
for the text of the label.fontSize
- Font size of the text of the label.align
- Alignment of the text of the label.textColor
- Color
of the text of the label.Font
,
TextAlign
,
Color
Method Detail |
---|
public void setAlign(TextAlign align)
TextAlign
enumeration that specifies the
text alignment of the label.
align
- TextAlign
enumeration that specifies the
text alignment of the label.TextAlign
public TextAlign getAlign()
TextAlign
enumeration that specifies the
text alignment of the label.
TextAlign
enumeration that specifies the
text alignment of the label.TextAlign
public void setVAlign(VAlign vAlign)
VAlign
enumeration that specifies the vertical
text alignment of the label.
vAlign
- VAlign
enumeration that specifies the
vertical text alignment of the label.VAlign
public VAlign getVAlign()
VAlign
enumeration that specifies the vertical
text alignment of the label.
VAlign
enumeration that specifies the vertical
text alignment of the label.VAlign
public void setUnderline(boolean underline)
underline
- value indicating if the label is underlined.public boolean getUnderline()
public void setText(java.lang.String text)
text
- the text of the label.public java.lang.String getText()
public void setTextColor(Color textColor)
Color
object to use for the text of the label.
textColor
- Color
object to use for the text
of the label.Color
public Color getTextColor()
Color
object to use for the text of the label.
Color
object used for the text of the label.Color
public void setFont(Font font)
Font
object to use for the text of the label.
font
- Font
object to use for the text of the label.Font
public Font getFont()
Font
object to use for the text of the label.
Font
object used for the text of the label.Font
public void setFontSize(float fontSize)
fontSize
- the font size for the text of the label.public float getFontSize()
public void setWidth(float width)
setWidth
in interface IArea
width
- the width of the label.public float getWidth()
getWidth
in interface IArea
public void setPageTotalOffset(int pageTotalOffset)
pageTotalOffset
- the page total offset for page numbering.public int getPageTotalOffset()
public void setPageOffset(int pageOffset)
pageOffset
- page offset for page numbering.public int getPageOffset()
public int getNumberingLength()
public void setNumberingLength(int numberingLength)
numberingLength
- length of the page numbering label.public char getNumberingPaddingCharacter()
public void setNumberingPaddingCharacter(char paddingChar)
paddingChar
- padding character of the page numbering label.protected void drawRotated(PageWriter writer)
PageWriter
object.
drawRotated
in class RotatingPageElement
writer
- PageWriter
object to receive the
label's output.PageWriter
|
DynamicPDF by ceTe Software | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |