org.zefer.pd4ml
Class PD4PageMark

java.lang.Object
  extended by org.zefer.pd4ml.PD4PageMark
All Implemented Interfaces:
java.io.Serializable

public class PD4PageMark
extends java.lang.Object
implements java.io.Serializable

See Also:
PD4ML.setPageFooter(PD4PageMark), PD4ML.setPageHeader(PD4PageMark), Serialized Form

Field Summary
static int CENTER_ALIGN
           
static int LEFT_ALIGN
           
static int RIGHT_ALIGN
           
 
Constructor Summary
PD4PageMark()
           
 
Method Summary
 boolean firstPageDiffers()
          checks if the header/footer definition for the first page differs the default definition
 int getAreaHeight()
          returns header or footer height.
 java.awt.Color getColor()
           
 java.awt.Font getFont()
          returns font currently used for header or footer
 java.awt.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()
           
 java.lang.String getHtmlTemplate()
          returns HTML template used to print entire document header/footer area.
 java.lang.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.
 java.awt.Color getPageBackgroundColor()
          returns default page background color
 java.awt.Color getPageBackgroundColor(int pageNumber)
          returns background color for the specified page The method can be overridden in order to add page dependent color definition
 java.lang.String getPageBackgroundImageUrl()
          returns default page background image URL
 java.lang.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
 java.lang.String getPageNumberTemplate()
          returns string template used to print page numbers
 java.lang.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
 java.lang.String getTitleTemplate()
          returns string template used to print document title in header or footer area
 java.lang.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
 java.awt.Rectangle getWatermarkBounds()
           
 int getWatermarkOpacity()
           
 java.lang.String getWatermarkUrl()
           
 void setAreaHeight(int i)
          defines height of the header or footer area
 void setColor(java.awt.Color color)
          setColor() sets the color of header or footer text
 void setFont(java.awt.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(java.lang.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(java.awt.Color pageBackgroundColor)
          defines default page background color
 void setPageBackgroundImageUrl(java.lang.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(java.lang.String string)
          defines a template for page number representation
No page numbering is printed, if the pageNumberTemplate is set to null.
 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.
 void setTitleTemplate(java.lang.String string)
          defines a template for page title representation.
 void setWatermark(java.lang.String url, java.awt.Rectangle bounds, int opacity)
          specifies watermark image to be printed on every page.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LEFT_ALIGN

public static final int LEFT_ALIGN
See Also:
Constant Field Values

CENTER_ALIGN

public static final int CENTER_ALIGN
See Also:
Constant Field Values

RIGHT_ALIGN

public static final int RIGHT_ALIGN
See Also:
Constant Field Values
Constructor Detail

PD4PageMark

public PD4PageMark()
Method Detail

setWatermark

public void setWatermark(java.lang.String url,
                         java.awt.Rectangle bounds,
                         int opacity)
specifies watermark image to be printed on every page. Available only in Pro version of PD4ML.

Parameters:
url - image location
bounds - image position and size in typographical points
opacity - image opacity in range from 0 to 100

getWatermarkBounds

public java.awt.Rectangle getWatermarkBounds()
Returns:
watermark image position and size in typographical points
See Also:
setWatermark(String, Rectangle, int)

getWatermarkOpacity

public int getWatermarkOpacity()
Returns:
watermark image opacity
See Also:
setWatermark(String, Rectangle, int)

getWatermarkUrl

public java.lang.String getWatermarkUrl()
Returns:
watermark image location
See Also:
setWatermark(String, Rectangle, int)

getInitialPageNumber

public int getInitialPageNumber()
returns initial value for the PDF document page counter.

Returns:
initial value
See Also:
setInitialPageNumber(int)

getPageNumberAlignment

public int getPageNumberAlignment()
returns page number alignment

Returns:
alignment
See Also:
setPageNumberAlignment(int), LEFT_ALIGN, RIGHT_ALIGN, CENTER_ALIGN

getPageNumberTemplate

public java.lang.String getPageNumberTemplate()
returns string template used to print page numbers

Returns:
template string
See Also:
setPageNumberTemplate(String)

getPageNumberTemplate

public java.lang.String getPageNumberTemplate(int pageNumber)
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:
setPagesToSkip(int)

getTitleAlignment

public int getTitleAlignment()
returns title alignment value

Returns:
alignment
See Also:
setTitleAlignment(int)

getTitleTemplate

public java.lang.String getTitleTemplate()
returns string template used to print document title in header or footer area

Returns:
template string
See Also:
setTitleTemplate(String)

getTitleTemplate

public java.lang.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

Parameters:
pageNumber - destination page number
Returns:
template string

getHtmlTemplate

public java.lang.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:
setTitleTemplate(String), setPageNumberTemplate(String), setHtmlTemplate(String)

getHtmlTemplate

public java.lang.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

Parameters:
pageNumber - destination page number
Returns:
template string

setHtmlTemplate

public void setHtmlTemplate(java.lang.String template)
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.

See Also:
setTitleTemplate(String), setPageNumberTemplate(String), setHtmlTemplate(String)

setInitialPageNumber

public void setInitialPageNumber(int i)
defines initial value for the PDF document page counter. Default is 1.

Parameters:
i - initial page number

setPageNumberAlignment

public void setPageNumberAlignment(int i)
                            throws java.security.InvalidParameterException
defines alignment for the page numbers in the document's header of footer area

Parameters:
i - - alignment
Throws:
java.security.InvalidParameterException
See Also:
LEFT_ALIGN, RIGHT_ALIGN, CENTER_ALIGN

setPageNumberTemplate

public void setPageNumberTemplate(java.lang.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.

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:
setHtmlTemplate(String)

setPagesToSkip

public void setPagesToSkip(int i)
                    throws java.security.InvalidParameterException
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:
java.security.InvalidParameterException

setTitleAlignment

public void setTitleAlignment(int i)
                       throws java.security.InvalidParameterException
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:
java.security.InvalidParameterException
See Also:
LEFT_ALIGN, RIGHT_ALIGN, CENTER_ALIGN

setTitleTemplate

public void setTitleTemplate(java.lang.String string)
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:
setHtmlTemplate(String)

getAreaHeight

public int getAreaHeight()
returns header or footer height.

Returns:
header/footer area height

setAreaHeight

public void setAreaHeight(int i)
                   throws java.security.InvalidParameterException
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:
java.security.InvalidParameterException

getColor

public java.awt.Color getColor()
Returns:
area color
See Also:
setColor(Color)

getFont

public java.awt.Font getFont()
returns font currently used for header or footer

Returns:
header/footer font

getFont

public java.awt.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

Parameters:
pageNumber - destination page number
Returns:
header/footer font for specified page

getFontSize

public int getFontSize()
Returns:
font size
See Also:
setFontSize(int)

setColor

public void setColor(java.awt.Color color)
setColor() sets the color of header or footer text

Parameters:
color -

setFontSize

public void setFontSize(int size)
                 throws java.security.InvalidParameterException
sets font size for the header of footer

Parameters:
size -
Throws:
java.security.InvalidParameterException

setFont

public void setFont(java.awt.Font font)
             throws java.security.InvalidParameterException
sets font for header (footer) (since v1.2.0b2)

Parameters:
font -
Throws:
java.security.InvalidParameterException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPageBackgroundColor

public java.awt.Color getPageBackgroundColor(int pageNumber)
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

public java.lang.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

Parameters:
pageNumber - destination page number
Returns:
background image URL for the specified page

getPageBackgroundColor

public java.awt.Color getPageBackgroundColor()
returns default page background color

Returns:
background color

setPageBackgroundColor

public void setPageBackgroundColor(java.awt.Color pageBackgroundColor)
defines default page background color

Parameters:
pageBackgroundColor -

getPageBackgroundImageUrl

public java.lang.String getPageBackgroundImageUrl()
returns default page background image URL

Returns:
background image URL

setPageBackgroundImageUrl

public void setPageBackgroundImageUrl(java.lang.String pageBackgroundImageUrl)
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



Copyright © 2004-15 zefer.org. All Rights Reserved.