Foxit PDF SDK
foxit::pdf::HeaderFooter类 参考

继承自 Object .

Public 成员函数

 HeaderFooter (const common::Font &font, float text_size, RGB text_color, const PageNumberRange &page_range, RectF page_margin, bool has_text_shrinked, bool has_fixedsize_for_print, int start_page_number, const HeaderFooterContent &content, bool is_to_embed_font, bool is_underline)
 Constructor, with parameters. 更多...
 
 HeaderFooter ()
 Constructor.
 
 HeaderFooter (const HeaderFooter &other)
 用另一个页眉页脚对象的构造函数。 更多...
 
HeaderFooter & operator= (const HeaderFooter &other)
 赋值操作符。 更多...
 
void Set (const common::Font &font, float text_size, RGB text_color, const PageNumberRange &page_range, RectF page_margin, bool has_text_shrinked, bool has_fixedsize_for_print, int start_page_number, const HeaderFooterContent &content, bool is_to_embed_font, bool is_underline)
 设置值。 更多...
 

Public 属性

HeaderFooterContent content
 页眉页脚内容。
 
common::Font font
 期望用于页眉页脚内容的有效字体对象。 更多...
 
bool has_fixedsize_for_print
 决定是否为打印使用固定大小的布尔值。
 
bool has_text_shrinked
 决定是否缩小文本的布尔值。
 
bool is_replace_font
 (保留)决定是否替换字体的布尔值。目前 Foxit PDF SDK 始终将此值设为 true。
 
bool is_to_embed_font
 决定是否嵌入字体的布尔值。
 
bool is_underline
 决定是否给文本加下划线的布尔值。
 
RectF page_margin
 指定页眉页脚内容位置的页边距。 如果用户未设置边距值,Foxit PDF SDK 将使用定义为 (72.0, 36.0, 72.0, 36.0) 的边距作为默认值。 更多...
 
PageNumberRange page_range
 指定当前页眉页脚使用页面的页码范围对象。 更多...
 
int start_page_number
 用于参数 page_range 中指定的第一页的虚拟页码。 这可以是任何数字,甚至与指定页面的实际页码不同。 更多...
 
RGB text_color
 用于页眉页脚内容的文本颜色。
 
float text_size
 页眉页脚内容的文本大小。
 

详细描述

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

构造及析构函数说明

◆ HeaderFooter() [1/2]

foxit::pdf::HeaderFooter::HeaderFooter ( const common::Font &  font,
float  text_size,
RGB  text_color,
const PageNumberRange &  page_range,
RectF  page_margin,
bool  has_text_shrinked,
bool  has_fixedsize_for_print,
int  start_page_number,
const HeaderFooterContent &  content,
bool  is_to_embed_font,
bool  is_underline 
)
inlineexplicit

Constructor, with 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]

foxit::pdf::HeaderFooter::HeaderFooter ( const HeaderFooter &  other)
inline

用另一个页眉页脚对象的构造函数。

参数
[in]other另一个页眉页脚对象。

成员函数说明

◆ operator=()

HeaderFooter& foxit::pdf::HeaderFooter::operator= ( const HeaderFooter &  other)
inline

赋值操作符。

参数
[in]other另一个页眉页脚对象,其值将被赋值给当前对象。
返回
对当前对象本身的引用。

◆ Set()

void foxit::pdf::HeaderFooter::Set ( const common::Font &  font,
float  text_size,
RGB  text_color,
const PageNumberRange &  page_range,
RectF  page_margin,
bool  has_text_shrinked,
bool  has_fixedsize_for_print,
int  start_page_number,
const HeaderFooterContent &  content,
bool  is_to_embed_font,
bool  is_underline 
)
inline

设置值。

参数
[in]font期望用于页眉页脚内容的有效字体对象。 请参阅当前对象的 font 注释。
[in]text_size页眉页脚内容的文本大小。
[in]text_color用于页眉页脚内容的文本颜色。
[in]page_range指定当前页眉页脚使用页面的页码范围对象。 请参阅当前对象的 page_range 注释。
[in]page_margin指定页眉页脚内容位置的页边距。 请参阅当前对象的 page_margin 注释。
[in]has_text_shrinked决定是否缩小文本的布尔值。
[in]has_fixedsize_for_print决定是否为打印使用固定大小的布尔值。
[in]start_page_number用于参数 page_range 中指定的第一页的虚拟页码。 这可以是任何数字,甚至与指定页面的实际页码不同。 如果此值小于 1,当当前页眉页脚对象在 PDF 文档中使用时,Foxit PDF SDK 将对此值使用 1。
[in]content页眉页脚内容。
[in]is_to_embed_font决定是否嵌入字体的布尔值。
[in]is_underline决定是否给文本加下划线的布尔值。
返回
无。

类成员变量说明

◆ font

common::Font foxit::pdf::HeaderFooter::font

期望用于页眉页脚内容的有效字体对象。

注解
有时,Foxit PDF SDK 无法将提取的字体与此字体对象匹配。 在这种情况下,Foxit PDF SDK 将为页眉页脚内容匹配一个类似的字体(与此字体对象不完全相同)。

◆ page_margin

RectF foxit::pdf::HeaderFooter::page_margin

指定页眉页脚内容位置的页边距。 如果用户未设置边距值,Foxit PDF SDK 将使用定义为 (72.0, 36.0, 72.0, 36.0) 的边距作为默认值。

注解
此值不表示矩形。它只是定义 PDF 页面的左边距、下边距、右边距和上边距。这些边距可用于将页眉页脚内容定位在不同的位置:
  • 左边距用于指定左页眉或页脚内容开始的位置。
  • 右边距用于指定右页眉或页脚内容结束的位置。
  • 下边距用于指定任何页脚内容放置的顶部位置。如果下边距不大于 0,页脚内容将不可见。
  • 上边距用于指定任何页眉内容放置的底部位置。如果上边距不大于 0,页眉内容将不可见。

◆ page_range

PageNumberRange foxit::pdf::HeaderFooter::page_range

指定当前页眉页脚使用页面的页码范围对象。

此范围中表示的所有值应从 1 开始且不超过使用当前页眉页脚对象的 PDF 文档的页数。

◆ start_page_number

int foxit::pdf::HeaderFooter::start_page_number

用于参数 page_range 中指定的第一页的虚拟页码。 这可以是任何数字,甚至与指定页面的实际页码不同。

注解
如果此值小于 1,当当前页眉页脚对象在 PDF 文档中使用时,Foxit PDF SDK 将对此值使用 1。