public class PD4PageMark extends Object implements Serializable
PD4ML.setPageFooter(PD4PageMark)
,
PD4ML.setPageHeader(PD4PageMark)
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
CENTER_ALIGN |
static int |
LEFT_ALIGN |
static int |
RIGHT_ALIGN |
Constructor and Description |
---|
PD4PageMark() |
Modifier and Type | Method and Description |
---|---|
boolean |
firstPageDiffers() |
int |
getAreaHeight()
returns header or footer height.
|
Color |
getColor() |
Font |
getFont()
returns font currently used for header or footer
|
Font |
getFont(int pageNumber)
returns font currently used for header or footer
The method can be overridden in order to add page dependent
header/footer font definition
|
int |
getFontSize() |
String |
getHtmlTemplate()
returns HTML template used to print entire document header/footer area.
|
String |
getHtmlTemplate(int pageNumber)
returns string template used to print HTML header or footer
The method can be overridden in order to add page dependent
template specification
|
int |
getInitialPageNumber()
returns initial value for the PDF document page counter.
|
Color |
getPageBackgroundColor()
returns default page background color
|
Color |
getPageBackgroundColor(int pageNumber)
returns background color for the specified page
The method can be overridden in order to add page dependent
color definition
|
String |
getPageBackgroundImageUrl()
returns default page background image URL
|
String |
getPageBackgroundImageUrl(int pageNumber)
returns background image URL for the specified page
The method can be overridden in order to add page dependent
background image definition
|
int |
getPageNumberAlignment()
returns page number alignment
|
String |
getPageNumberTemplate()
returns string template used to print page numbers
|
String |
getPageNumberTemplate(int pageNumber)
returns string template used to print page numbers.
|
int |
getPagesToSkip()
returns number of pages that should not be
marked with header or footer area
|
int |
getTitleAlignment()
returns title alignment value
|
String |
getTitleTemplate()
returns string template used to print document title
in header or footer area
|
String |
getTitleTemplate(int pageNumber)
returns string template used to print document title
in header or footer area
The method can be overridden in order to add page dependent
template specification
|
Rectangle |
getWatermarkBounds() |
int |
getWatermarkOpacity() |
String |
getWatermarkUrl() |
void |
setAreaHeight(int i)
defines height of the header or footer area
|
void |
setColor(Color color)
setColor() sets the color of header or footer text
|
void |
setFont(Font font)
sets font for header (footer) (since v1.2.0b2)
|
void |
setFontSize(int size)
sets font size for the header of footer
|
void |
setHtmlTemplate(String template)
sets HTML template used to print entire document header/footer area.
|
void |
setInitialPageNumber(int i)
defines initial value for the
PDF document page counter.
|
void |
setPageBackgroundColor(Color pageBackgroundColor)
defines default page background color
|
void |
setPageBackgroundImageUrl(String pageBackgroundImageUrl)
defines default page background image (form, letterhead)
|
void |
setPageNumberAlignment(int i)
defines alignment for the page numbers
in the document's header of footer area
|
void |
setPageNumberTemplate(String string)
defines a template for page number representation
No page numbering is printed, if the pageNumberTemplate is set to null. Default value is null. If HTML template specified, than the method call is ignored. |
void |
setPagesToSkip(int i)
defines a number of pages from the document beginning, that should not
be marked with the header or footer info.
|
void |
setTitleAlignment(int i)
defines alignment for the page title string
in the document's header of footer.
Note: only single line headers are supported |
void |
setTitleTemplate(String string)
defines a template for page title representation.
No title is printed, if the titleTemplate is set to null. |
void |
setWatermark(String url,
Rectangle bounds,
int opacity)
specifies watermark image to be printed on every page.
|
String |
toString() |
public static final int LEFT_ALIGN
public static final int CENTER_ALIGN
public static final int RIGHT_ALIGN
public void setWatermark(String url, Rectangle bounds, int opacity)
url
- image locationbounds
- image position and size in typographical pointsopacity
- image opacity in range from 0 to 100public Rectangle getWatermarkBounds()
setWatermark(String, Rectangle, int)
public int getWatermarkOpacity()
setWatermark(String, Rectangle, int)
public String getWatermarkUrl()
setWatermark(String, Rectangle, int)
public int getInitialPageNumber()
setInitialPageNumber(int)
public int getPageNumberAlignment()
setPageNumberAlignment(int)
,
LEFT_ALIGN
,
RIGHT_ALIGN
,
CENTER_ALIGN
public String getPageNumberTemplate()
setPageNumberTemplate(String)
public String getPageNumberTemplate(int pageNumber)
pageNumber
- destination page numberpublic int getPagesToSkip()
setPagesToSkip(int)
public int getTitleAlignment()
setTitleAlignment(int)
public String getTitleTemplate()
setTitleTemplate(String)
public String getTitleTemplate(int pageNumber)
pageNumber
- destination page numberpublic String getHtmlTemplate()
setTitleTemplate(String)
,
setPageNumberTemplate(String)
,
setHtmlTemplate(String)
public String getHtmlTemplate(int pageNumber)
pageNumber
- destination page numberpublic void setHtmlTemplate(String template)
template
- HTML code to be used as header/footer layoutsetTitleTemplate(String)
,
setPageNumberTemplate(String)
,
setHtmlTemplate(String)
public void setInitialPageNumber(int i)
i
- initial page numberpublic void setPageNumberAlignment(int i) throws InvalidParameterException
i
- - alignmentInvalidParameterException
- by invalid parameter(s)LEFT_ALIGN
,
RIGHT_ALIGN
,
CENTER_ALIGN
public void setPageNumberTemplate(String string)
string
- a string with static text or/and special markups: ${page} - for current
page number, ${total} - for total number of pages in the document. The both numeric values
can be affected by setInitailPageNumber()setHtmlTemplate(String)
public void setPagesToSkip(int i) throws InvalidParameterException
i
- number of pages to skipInvalidParameterException
- by invalid parameter(s)public void setTitleAlignment(int i) throws InvalidParameterException
i
- - alignmentInvalidParameterException
- by invalid parameter(s)LEFT_ALIGN
,
RIGHT_ALIGN
,
CENTER_ALIGN
public void setTitleTemplate(String string)
string
- a string with static text or/and special markups: ${title} -
page title, ${page} - current page number, ${total} - for total number of
pages in the document. The both numeric values can be affected by
setInitailPageNumber() callsetHtmlTemplate(String)
public int getAreaHeight()
public void setAreaHeight(int i) throws InvalidParameterException
i
- height in points; "-1" value forces PD4ML to predict HTML header or footer height
and to use the calculated value.InvalidParameterException
- by invalid parameter(s)public Color getColor()
setColor(Color)
public Font getFont()
public Font getFont(int pageNumber)
pageNumber
- destination page numberpublic int getFontSize()
setFontSize(int)
public void setColor(Color color)
color
- AWT colorpublic void setFontSize(int size) throws InvalidParameterException
size
- font sizeInvalidParameterException
- by invalid parameter(s)public void setFont(Font font) throws InvalidParameterException
font
- AWT font instanceInvalidParameterException
- by invalid parameter(s)public Color getPageBackgroundColor(int pageNumber)
pageNumber
- destination page numberpublic String getPageBackgroundImageUrl(int pageNumber)
pageNumber
- destination page numberpublic Color getPageBackgroundColor()
public void setPageBackgroundColor(Color pageBackgroundColor)
pageBackgroundColor
- AWT colorpublic String getPageBackgroundImageUrl()
public void setPageBackgroundImageUrl(String pageBackgroundImageUrl)
pageBackgroundImageUrl
- background image URL stringpublic boolean firstPageDiffers()
Revision 4.0.15 / 20220727-0149