Foxit PDF SDK
com.foxit.sdk.pdf.HeaderFooter Class Reference

Public Member Functions

 HeaderFooter ()
 Constructor.

 
 HeaderFooter (Font font, float text_size, long text_color, PageNumberRange page_range, RectF page_margin, boolean has_text_shrinked, boolean has_fixedsize_for_print, int start_page_number, HeaderFooterContent content, boolean is_to_embed_font, boolean is_underline)
 Constructor, with parameters.
More...
 
 HeaderFooter (HeaderFooter other)
 Constructor, with another header-footer object.
More...
 
synchronized void delete ()
 Clean up related resources immediately. More...
 
HeaderFooterContent getContent ()
 Get header-footer content. More...
 
Font getFont ()
 Get a valid font object which is expected to be used for header-footer content. More...
 
boolean getHas_fixedsize_for_print ()
 Get a boolean value that decides whether to use fixed size for print or not. More...
 
boolean getHas_text_shrinked ()
 Get a boolean value that decides whether to shrink text or not. More...
 
boolean getIs_replace_font ()
 Get (Reserved) A boolean value that decides whether to replace font or not. More...
 
boolean getIs_to_embed_font ()
 Get a boolean value that decides whether to embed font or not. More...
 
boolean getIs_underline ()
 Get a boolean value that decides whether to underline text or not. More...
 
RectF getPage_margin ()
 Get page margin which specifies the location for header-footer content. More...
 
PageNumberRange getPage_range ()
 Get a page number range object which specifies pages where current header-footer is used. More...
 
int getStart_page_number ()
 Get a virtual page number used for the first page specified in parameter page_range. More...
 
long getText_color ()
 Get text color used for header-footer content. More...
 
float getText_size ()
 Get text size of header-footer content. More...
 
void set (Font font, float text_size, long text_color, PageNumberRange page_range, RectF page_margin, boolean has_text_shrinked, boolean has_fixedsize_for_print, int start_page_number, HeaderFooterContent content, boolean is_to_embed_font, boolean is_underline)
 Set value.
More...
 
void setContent (HeaderFooterContent value)
 Set header-footer content. More...
 
void setFont (Font value)
 Set a valid font object which is expected to be used for header-footer content. More...
 
void setHas_fixedsize_for_print (boolean value)
 Set a boolean value that decides whether to use fixed size for print or not. More...
 
void setHas_text_shrinked (boolean value)
 Set a boolean value that decides whether to shrink text or not. More...
 
void setIs_replace_font (boolean value)
 Set (Reserved) A boolean value that decides whether to replace font or not. More...
 
void setIs_to_embed_font (boolean value)
 Set a boolean value that decides whether to embed font or not. More...
 
void setIs_underline (boolean value)
 Set a boolean value that decides whether to underline text or not. More...
 
void setPage_margin (RectF value)
 Set page margin which specifies the location for header-footer content. More...
 
void setPage_range (PageNumberRange value)
 Set a page number range object which specifies pages where current header-footer is used. More...
 
void setStart_page_number (int value)
 Set a virtual page number used for the first page specified in parameter page_range. More...
 
void setText_color (long value)
 Set text color used for header-footer content. More...
 
void setText_size (float value)
 Set text size of header-footer content. More...
 

Detailed Description

This class represents properties and data for a header-footer.

Constructor & Destructor Documentation

◆ HeaderFooter() [1/2]

com.foxit.sdk.pdf.HeaderFooter.HeaderFooter ( Font  font,
float  text_size,
long  text_color,
PageNumberRange  page_range,
RectF  page_margin,
boolean  has_text_shrinked,
boolean  has_fixedsize_for_print,
int  start_page_number,
HeaderFooterContent  content,
boolean  is_to_embed_font,
boolean  is_underline 
)

Constructor, with parameters.

Parameters
[in]fontA valid font object used for header-footer content. Please refer to comment of font of current object.
[in]text_sizeText size of header-footer content.
[in]text_colorText color used for header-footer content.
[in]page_rangeA page number range object which specifies pages where current header-footer is used. Please refer to comment of page_range of current object.
[in]page_marginPage margin which specifies the location for header-footer content. Please refer to comment of page_margin of current object.
[in]has_text_shrinkedA boolean value that decides whether to shrink text or not.
[in]has_fixedsize_for_printA boolean value that decides whether to use fixed size for print or not.
[in]start_page_numberA virtual page number used for the first page specified in parameter page_range. This can be any number, even different from the actual page number of the specified page. If this value is less than 1, Foxit PDF SDK will use 1 for this value when current header-footer object is used in a PDF document.
[in]contentHeader-footer content.
[in]is_to_embed_fontA boolean value that decides whether to embed font or not.
[in]is_underlineA boolean value that decides whether to underline text or not.

◆ HeaderFooter() [2/2]

com.foxit.sdk.pdf.HeaderFooter.HeaderFooter ( HeaderFooter  other)

Constructor, with another header-footer object.

Parameters
[in]otherAnother header-footer object.

Member Function Documentation

◆ delete()

synchronized void com.foxit.sdk.pdf.HeaderFooter.delete ( )

Clean up related resources immediately.

Returns
None.
Note
Once this function is called, current object cannot be used anymore.

◆ getContent()

com.foxit.sdk.pdf.HeaderFooter.getContent ( )

Get header-footer content.

Returns
Header-footer content.

◆ getFont()

com.foxit.sdk.pdf.HeaderFooter.getFont ( )

Get a valid font object which is expected to be used for header-footer content.

Note
Sometimes, Foxit PDF SDK cannot match an extract font with this font object. In this case, Foxit PDF SDK will match a similar font (which is not exactly same as this font object) for heasder-footer content instead.
Returns
A valid font object which is expected to be used for header-footer content.

◆ getHas_fixedsize_for_print()

com.foxit.sdk.pdf.HeaderFooter.getHas_fixedsize_for_print ( )

Get a boolean value that decides whether to use fixed size for print or not.

Returns
A boolean value that decides whether to use fixed size for print or not.

◆ getHas_text_shrinked()

com.foxit.sdk.pdf.HeaderFooter.getHas_text_shrinked ( )

Get a boolean value that decides whether to shrink text or not.

Returns
A boolean value that decides whether to shrink text or not.

◆ getIs_replace_font()

com.foxit.sdk.pdf.HeaderFooter.getIs_replace_font ( )

Get (Reserved) A boolean value that decides whether to replace font or not.

Returns
(Reserved) A boolean value that decides whether to replace font or not. Currently Foxit PDF SDK will use this as true all the time.

◆ getIs_to_embed_font()

com.foxit.sdk.pdf.HeaderFooter.getIs_to_embed_font ( )

Get a boolean value that decides whether to embed font or not.

Returns
A boolean value that decides whether to embed font or not.

◆ getIs_underline()

com.foxit.sdk.pdf.HeaderFooter.getIs_underline ( )

Get a boolean value that decides whether to underline text or not.

Returns
A boolean value that decides whether to underline text or not.

◆ getPage_margin()

com.foxit.sdk.pdf.HeaderFooter.getPage_margin ( )

Get page margin which specifies the location for header-footer content.

Note
This value does not represent a rectangle. It just defines the left margin, bottom margin, right margin and top margin of a PDF page. These margins can be used to locate header-footer content in different places:
  • Left margin is used to specify the location for left header or footer content to be started.
  • Right margin is used to specify the location for right header or footer content to be ended.
  • Bottom margin is used to specify the top location for any footer content to be placed. If bottom margin is no more than 0, the footer content will be invisible.
  • Top margin is used to specify the bottom location for any header content to be placed. If top margin is no more than 0, the header content will be invisible.

Returns
Page margin which specifies the location for header-footer content. Foxit PDF SDK will use a maring defined as (72.0, 36.0, 72.0, 36.0) as default if no margin value is set by user.

◆ getPage_range()

com.foxit.sdk.pdf.HeaderFooter.getPage_range ( )

Get a page number range object which specifies pages where current header-footer is used.

All the values represented in this range should start from 1 and no more than page count of the PDF document, in which current header-footer object is used.

Returns
A page number range object which specifies pages where current header-footer is used.

◆ getStart_page_number()

com.foxit.sdk.pdf.HeaderFooter.getStart_page_number ( )

Get a virtual page number used for the first page specified in parameter page_range.

Note
If this value is less than 1, Foxit PDF SDK will use 1 for this value when current header-footer object is used in a PDF document.
Returns
A virtual page number used for the first page specified in parameter page_range. This can be any number, even different from the actual page number of the specified page.

◆ getText_color()

com.foxit.sdk.pdf.HeaderFooter.getText_color ( )

Get text color used for header-footer content.

Returns
Text color used for header-footer content.

◆ getText_size()

com.foxit.sdk.pdf.HeaderFooter.getText_size ( )

Get text size of header-footer content.

Returns
Text size of header-footer content.

◆ set()

void com.foxit.sdk.pdf.HeaderFooter.set ( Font  font,
float  text_size,
long  text_color,
PageNumberRange  page_range,
RectF  page_margin,
boolean  has_text_shrinked,
boolean  has_fixedsize_for_print,
int  start_page_number,
HeaderFooterContent  content,
boolean  is_to_embed_font,
boolean  is_underline 
)

Set value.

Parameters
[in]fontA valid font object which is expected to be used for header-footer content. Please refer to comment of font of current object.
[in]text_sizeText size of header-footer content.
[in]text_colorText color used for header-footer content.
[in]page_rangeA page number range object which specifies pages where current header-footer is used. Please refer to comment of page_range of current object.
[in]page_marginPage margin which specifies the location for header-footer content. Please refer to comment of page_margin of current object.
[in]has_text_shrinkedA boolean value that decides whether to shrink text or not.
[in]has_fixedsize_for_printA boolean value that decides whether to use fixed size for print or not.
[in]start_page_numberA virtual page number used for the first page specified in parameter page_range. This can be any number, even different from the actual page number of the specified page. If this value is less than 1, Foxit PDF SDK will use 1 for this value when current header-footer object is used in a PDF document.
[in]contentHeader-footer content.
[in]is_to_embed_fontA boolean value that decides whether to embed font or not.
[in]is_underlineA boolean value that decides whether to underline text or not.
Returns
None.

◆ setContent()

com.foxit.sdk.pdf.HeaderFooter.setContent ( HeaderFooterContent  value)

Set header-footer content.

Parameters
[in]valueHeader-footer content.
Returns
None.

◆ setFont()

com.foxit.sdk.pdf.HeaderFooter.setFont ( Font  value)

Set a valid font object which is expected to be used for header-footer content.

Note
Sometimes, Foxit PDF SDK cannot match an extract font with this font object. In this case, Foxit PDF SDK will match a similar font (which is not exactly same as this font object) for heasder-footer content instead.
Parameters
[in]valueA valid font object which is expected to be used for header-footer content.
Returns
None.

◆ setHas_fixedsize_for_print()

com.foxit.sdk.pdf.HeaderFooter.setHas_fixedsize_for_print ( boolean  value)

Set a boolean value that decides whether to use fixed size for print or not.

Parameters
[in]valueA boolean value that decides whether to use fixed size for print or not.
Returns
None.

◆ setHas_text_shrinked()

com.foxit.sdk.pdf.HeaderFooter.setHas_text_shrinked ( boolean  value)

Set a boolean value that decides whether to shrink text or not.

Parameters
[in]valueA boolean value that decides whether to shrink text or not.
Returns
None.

◆ setIs_replace_font()

com.foxit.sdk.pdf.HeaderFooter.setIs_replace_font ( boolean  value)

Set (Reserved) A boolean value that decides whether to replace font or not.

Parameters
[in]value(Reserved) A boolean value that decides whether to replace font or not. Currently Foxit PDF SDK will use this as true all the time.
Returns
None.

◆ setIs_to_embed_font()

com.foxit.sdk.pdf.HeaderFooter.setIs_to_embed_font ( boolean  value)

Set a boolean value that decides whether to embed font or not.

Parameters
[in]valueA boolean value that decides whether to embed font or not.
Returns
None.

◆ setIs_underline()

com.foxit.sdk.pdf.HeaderFooter.setIs_underline ( boolean  value)

Set a boolean value that decides whether to underline text or not.

Parameters
[in]valueA boolean value that decides whether to underline text or not.
Returns
None.

◆ setPage_margin()

com.foxit.sdk.pdf.HeaderFooter.setPage_margin ( RectF  value)

Set page margin which specifies the location for header-footer content.

Note
This value does not represent a rectangle. It just defines the left margin, bottom margin, right margin and top margin of a PDF page. These margins can be used to locate header-footer content in different places:
  • Left margin is used to specify the location for left header or footer content to be started.
  • Right margin is used to specify the location for right header or footer content to be ended.
  • Bottom margin is used to specify the top location for any footer content to be placed. If bottom margin is no more than 0, the footer content will be invisible.
  • Top margin is used to specify the bottom location for any header content to be placed. If top margin is no more than 0, the header content will be invisible.

Parameters
[in]valuePage margin which specifies the location for header-footer content. Foxit PDF SDK will use a maring defined as (72.0, 36.0, 72.0, 36.0) as default if no margin value is set by user.
Returns
None.

◆ setPage_range()

com.foxit.sdk.pdf.HeaderFooter.setPage_range ( PageNumberRange  value)

Set a page number range object which specifies pages where current header-footer is used.

All the values represented in this range should start from 1 and no more than page count of the PDF document, in which current header-footer object is used.

Parameters
[in]valueA page number range object which specifies pages where current header-footer is used.
Returns
None.

◆ setStart_page_number()

com.foxit.sdk.pdf.HeaderFooter.setStart_page_number ( int  value)

Set a virtual page number used for the first page specified in parameter page_range.

Note
If this value is less than 1, Foxit PDF SDK will use 1 for this value when current header-footer object is used in a PDF document.
Parameters
[in]valueA virtual page number used for the first page specified in parameter page_range. This can be any number, even different from the actual page number of the specified page.
Returns
None.

◆ setText_color()

com.foxit.sdk.pdf.HeaderFooter.setText_color ( long  value)

Set text color used for header-footer content.

Parameters
[in]valueText color used for header-footer content.
Returns
None.

◆ setText_size()

com.foxit.sdk.pdf.HeaderFooter.setText_size ( float  value)

Set text size of header-footer content.

Parameters
[in]valueText size of header-footer content.
Returns
None.