Package org.zefer.pd4ml
Class PD4PageMark
java.lang.Object
org.zefer.pd4ml.PD4PageMark
- All Implemented Interfaces:
Serializable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checks if the header/footer definition for the first page differs the default definitionint
returns header or footer height.getColor()
getFont()
returns font currently used for header or footergetFont
(int pageNumber) returns font currently used for header or footer The method can be overridden in order to add page dependent header/footer font definitionint
returns HTML template used to print entire document header/footer area.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 specificationint
returns initial value for the PDF document page counter.returns default page background colorgetPageBackgroundColor
(int pageNumber) returns background color for the specified page The method can be overridden in order to add page dependent color definitionreturns default page background image URLgetPageBackgroundImageUrl
(int pageNumber) returns background image URL for the specified page The method can be overridden in order to add page dependent background image definitionint
returns page number alignmentreturns string template used to print page numbersgetPageNumberTemplate
(int pageNumber) returns string template used to print page numbers.int
returns number of pages that should not be marked with header or footer areaint
returns title alignment valuereturns string template used to print document title in header or footer areagetTitleTemplate
(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 specificationint
getWatermarkUrl
(int pageNumber) void
setAreaHeight
(int i) defines height of the header or footer areavoid
setColor() sets the color of header or footer textvoid
sets font for header (footer) (since v1.2.0b2)void
setFontSize
(int size) sets font size for the header of footervoid
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 colorvoid
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 areavoid
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 supportedvoid
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.toString()
-
Field Details
-
LEFT_ALIGN
public static final int LEFT_ALIGN- See Also:
-
CENTER_ALIGN
public static final int CENTER_ALIGN- See Also:
-
RIGHT_ALIGN
public static final int RIGHT_ALIGN- See Also:
-
-
Constructor Details
-
PD4PageMark
public PD4PageMark()
-
-
Method Details
-
setWatermark
specifies watermark image to be printed on every page. Available only in Pro version of PD4ML.- Parameters:
url
- image locationbounds
- image position and size in typographical pointsopacity
- image opacity in range from 0 to 100
-
getWatermarkBounds
- Returns:
- watermark image position and size in typographical points
- See Also:
-
getWatermarkOpacity
public int getWatermarkOpacity()- Returns:
- watermark image opacity
- See Also:
-
getWatermarkUrl
- Returns:
- watermark image location
- See Also:
-
getWatermarkUrl
- Returns:
- watermark image location
- See Also:
-
getInitialPageNumber
public int getInitialPageNumber()returns initial value for the PDF document page counter.- Returns:
- initial value
- See Also:
-
getPageNumberAlignment
public int getPageNumberAlignment()returns page number alignment- Returns:
- alignment
- See Also:
-
getPageNumberTemplate
returns string template used to print page numbers- Returns:
- template string
- See Also:
-
getPageNumberTemplate
returns string template used to print page numbers. The method can be overridden in order to add page dependent template specification- Parameters:
pageNumber
- destination page number- Returns:
- template string
-
getPagesToSkip
public int getPagesToSkip()returns number of pages that should not be marked with header or footer area- Returns:
- number of pages
- See Also:
-
getTitleAlignment
public int getTitleAlignment()returns title alignment value- Returns:
- alignment
- See Also:
-
getTitleTemplate
returns string template used to print document title in header or footer area- Returns:
- template string
- See Also:
-
getTitleTemplate
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- Parameters:
pageNumber
- destination page number- Returns:
- template string
-
getHtmlTemplate
returns HTML template used to print entire document header/footer area. If HTML template specified, than titleTemplate and pageNumberTemplate attributes are ignored. Available only in Pro version of PD4ML.- Returns:
- template string
- See Also:
-
getHtmlTemplate
returns string template used to print HTML header or footer The method can be overridden in order to add page dependent template specification- Parameters:
pageNumber
- destination page number- Returns:
- template string
-
setHtmlTemplate
sets HTML template used to print entire document header/footer area. If HTML template specified, than titleTemplate and pageNumberTemplate attributes are ignored. Available only in Pro version of PD4ML. -
setInitialPageNumber
public void setInitialPageNumber(int i) defines initial value for the PDF document page counter. Default is 1.- Parameters:
i
- initial page number
-
setPageNumberAlignment
defines alignment for the page numbers in the document's header of footer area- Parameters:
i
- - alignment- Throws:
InvalidParameterException
- See Also:
-
setPageNumberTemplate
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.- Parameters:
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()- See Also:
-
setPagesToSkip
defines a number of pages from the document beginning, that should not be marked with the header or footer info.- Parameters:
i
- number of pages to skip- Throws:
InvalidParameterException
-
setTitleAlignment
defines alignment for the page title string in the document's header of footer.
Note: only single line headers are supported- Parameters:
i
- - alignment- Throws:
InvalidParameterException
- See Also:
-
setTitleTemplate
defines a template for page title representation.
No title is printed, if the titleTemplate is set to null. Default value is null.
If HTML template specified, than the method call is ignored.- Parameters:
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() call- See Also:
-
getAreaHeight
public int getAreaHeight()returns header or footer height.- Returns:
- header/footer area height
-
setAreaHeight
defines height of the header or footer area- Parameters:
i
- height in points; "-1" value forces PD4ML to predict HTML header or footer height and to use the calculated value.- Throws:
InvalidParameterException
-
getColor
- Returns:
- area color
- See Also:
-
getFont
returns font currently used for header or footer- Returns:
- header/footer font
-
getFont
returns font currently used for header or footer The method can be overridden in order to add page dependent header/footer font definition- Parameters:
pageNumber
- destination page number- Returns:
- header/footer font for specified page
-
getFontSize
public int getFontSize()- Returns:
- font size
- See Also:
-
setColor
setColor() sets the color of header or footer text- Parameters:
color
-
-
setFontSize
sets font size for the header of footer- Parameters:
size
-- Throws:
InvalidParameterException
-
setFont
sets font for header (footer) (since v1.2.0b2)- Parameters:
font
-- Throws:
InvalidParameterException
-
toString
-
getPageBackgroundColor
returns background color for the specified page The method can be overridden in order to add page dependent color definition- Parameters:
pageNumber
- destination page number- Returns:
- background color for the specified page
-
getPageBackgroundImageUrl
returns background image URL for the specified page The method can be overridden in order to add page dependent background image definition- Parameters:
pageNumber
- destination page number- Returns:
- background image URL for the specified page
-
getPageBackgroundColor
returns default page background color- Returns:
- background color
-
setPageBackgroundColor
defines default page background color- Parameters:
pageBackgroundColor
-
-
getPageBackgroundImageUrl
returns default page background image URL- Returns:
- background image URL
-
setPageBackgroundImageUrl
defines default page background image (form, letterhead)- Parameters:
pageBackgroundImageUrl
-
-
firstPageDiffers
public boolean firstPageDiffers()checks if the header/footer definition for the first page differs the default definition
-