Foxit PDF SDK
foxit::ofd::OFDPage类 参考
类 foxit::ofd::OFDPage 继承关系图:
foxit::Base foxit::ofd::OFDTemplatePage

Public 类型

enum  PageBoxType {
  e_BleedBox = 0, e_PhysicalBox = 1, e_ApplicationBox = 2, e_ContentBox = 3,
  e_CropBox = 4
}
 OFD页面区域类型枚举。 更多...
 

Public 成员函数

 OFDPage (const OFDPage &other)
 构造函数,通过另一个OFD页面对象。 更多...
 
 ~OFDPage ()
 析构函数。
 
Annot AddAnnot (Annot::AnnotType type)
 新建一个标注对象并添加到页中。 更多...
 
OFDLayer AddLayer ()
 新建一个层,并追加至页中。 更多...
 
foxit::ofd::graphics::OFDBlockObject AddPageBlock ()
 新建一个页面块。这个接口将创建一个Layer插入到页面,在Layer中添加页面块。 更多...
 
bool FillRect (const RectF &rect, foxit::RGB color)
 将指定区域填充为指定颜色。 更多...
 
Actions GetActions () const
 获取页面动作数组。 更多...
 
Annot GetAnnot (int index)
 按索引获取标注对象。 更多...
 
Annot GetAnnotByID (foxit::uint32 id)
 按ID获取标注对象。 更多...
 
int GetAnnotCount ()
 获取页中标注数量。 更多...
 
Matrix GetDisplayMatrix (int left, int top, int width, int height, common::Rotation rotate) const
 计算渲染矩阵。 更多...
 
int GetID () const
 获取页ID。 更多...
 
int GetIndex () const
 获取页索引。 更多...
 
OFDLayer GetLayer (int index) const
 获取指定索引的层句柄。 更多...
 
int GetLayerCount () const
 获取页中层数。 更多...
 
RectF GetPageBox (PageBoxType box_type) const
 获取页面区域。 更多...
 
common::Rotation GetRotation () const
 获取页面旋转角度。 更多...
 
int GetTemplatePageCount () const
 获取页中模板页数。 更多...
 
WString GetTextByLineIndex (int index)
 获取指定行的文本内容。 更多...
 
int GetTextLineCount ()
 获取页面文本行数。 更多...
 
OFDLayer InsertLayer (int index)
 新建一个层,并插入页中指定位置。 更多...
 
foxit::ofd::graphics::OFDBlockObject InsertPageBlock (int index)
 新建一个页面块。这个接口将创建一个Layer插入到页面,在Layer中添加页面块。 更多...
 
bool IsDoubleLayer ()
 判断页面是否为双层页面。 更多...
 
bool IsEmpty () const
 检查当前对象是否为空。 更多...
 
bool IsTemplatePage () const
 判断当前页面是否为模板页。 更多...
 
bool MaskCharacterWithBlack (const RectF &rect, int shape)
 通过涂黑进行页面信息屏蔽。 更多...
 
bool MaskCharacterWithBlur (const RectF &rect, int shape, int horz_blur, int vert_blur)
 通过模糊进行页面信息屏蔽。 更多...
 
bool MaskCharacterWithMosaic (const RectF &rect, int shape, int vector_length)
 通过马赛克进行页面信息屏蔽。 更多...
 
bool operator != (const OFDPage &other) const
 不相等操作符。 更多...
 
OFDPageoperator= (const OFDPage &other)
 赋值操作符。 更多...
 
bool operator== (const OFDPage &other) const
 相等操作符。 更多...
 
bool PreMaskCharacterByRect (const RectF &rect, foxit::ARGB color)
 页面信息预遮盖,可恢复。 更多...
 
bool RemoveAnnot (int index)
 删除指定索引的标注对象。 更多...
 
bool RemoveLayer (int index)
 删除指定索引的层。 更多...
 
bool RemovePageBlock (int index)
 删除指定索引页面块。 更多...
 
bool ReplaceCharacterBySearch (TextSearchCharInfo char_info, foxit::uint8 character='X')
 根据搜索结果,完成字符替换。 更多...
 
bool ReplaceCharacterInRect (const RectF &rect, bool recover=true, foxit::uint8 character='X')
 根据矩形区域,完成字符替换。 更多...
 
bool SetPageBox (PageBoxType box_type, const RectF &rect)
 设置页面区域。 更多...
 
bool SetRotation (common::Rotation rotate)
 设置页面旋转。 更多...
 
bool SetTemplatePage (OFDPage template_page, foxit::ofd::OFDLayer::LayerType order=foxit::ofd::OFDLayer::e_LayerTypeBody)
 设置模板页属性。 更多...
 
bool SetTemplatePageByID (int template_id, foxit::ofd::OFDLayer::LayerType order=foxit::ofd::OFDLayer::e_LayerTypeBody)
 根据指定ID,设置页面的模板属性和呈现顺序。 更多...
 
- Public 成员函数 继承自 foxit::Base
FS_HANDLE Handle () const
 获取当前对象的句柄。 更多...
 

详细描述

此类表示和OFD页面相关的方法。

成员枚举类型说明

◆ PageBoxType

OFD页面区域类型枚举。

该枚举值应单独使用。

枚举值
e_BleedBox 

出血框,超出物理设备限制的额外出血区域,默认为物理区域。

e_PhysicalBox 

物理区域。

e_ApplicationBox 

显示区域,页面内容实际显示或打印输出区域。

e_ContentBox 

版心区域即文件正文区域。

e_CropBox 

裁剪区域。

构造及析构函数说明

◆ OFDPage()

foxit::ofd::OFDPage::OFDPage ( const OFDPage other)

构造函数,通过另一个OFD页面对象。

参数
[in]other另一个OFD页面对象。

成员函数说明

◆ AddAnnot()

Annot foxit::ofd::OFDPage::AddAnnot ( Annot::AnnotType  type)

新建一个标注对象并添加到页中。

参数
[in]type标注类型。 请参考从 foxit::ofd::Annot::AnnotType::e_AnnotTypeUnknown 开始的值。
返回
标注对象。

◆ AddLayer()

OFDLayer foxit::ofd::OFDPage::AddLayer ( )

新建一个层,并追加至页中。

返回
层对象。

◆ AddPageBlock()

foxit::ofd::graphics::OFDBlockObject foxit::ofd::OFDPage::AddPageBlock ( )

新建一个页面块。这个接口将创建一个Layer插入到页面,在Layer中添加页面块。

返回
返回页面块对象。

◆ FillRect()

bool foxit::ofd::OFDPage::FillRect ( const RectF rect,
foxit::RGB  color 
)

将指定区域填充为指定颜色。

参数
[in]rect矩形区域。坐标系为OFD坐标系。
[in]color填充颜色, RGB值。
返回
true代表填充成功, false代表填充失败。

◆ GetActions()

Actions foxit::ofd::OFDPage::GetActions ( ) const

获取页面动作数组。

返回
页面动作数组句柄。

◆ GetAnnot()

Annot foxit::ofd::OFDPage::GetAnnot ( int  index)

按索引获取标注对象。

参数
[in]index标注索引。有效范围:从0到(count-1)。 count 由函数 OFDPage::GetAnnotCount 返回。
返回
标注对象。

◆ GetAnnotByID()

Annot foxit::ofd::OFDPage::GetAnnotByID ( foxit::uint32  id)

按ID获取标注对象。

参数
[in]id标注ID。
返回
标注对象。

◆ GetAnnotCount()

int foxit::ofd::OFDPage::GetAnnotCount ( )

获取页中标注数量。

返回
标注数量。

◆ GetDisplayMatrix()

Matrix foxit::ofd::OFDPage::GetDisplayMatrix ( int  left,
int  top,
int  width,
int  height,
common::Rotation  rotate 
) const

计算渲染矩阵。

参数
[in]left设备区域左上角X坐标。
[in]top设备区域左上角Y坐标。
[in]width设备区域宽度。
[in]height设备区域高度。
[in]rotate旋转角度。
返回
渲染矩阵。

◆ GetID()

int foxit::ofd::OFDPage::GetID ( ) const

获取页ID。

返回
返回页ID。

◆ GetIndex()

int foxit::ofd::OFDPage::GetIndex ( ) const

获取页索引。

返回
返回页索引。

◆ GetLayer()

OFDLayer foxit::ofd::OFDPage::GetLayer ( int  index) const

获取指定索引的层句柄。

参数
[in]index指定层的索引。有效范围:从0到(count-1)。 count 由函数 OFDPage::GetLayerCount 返回。
返回
层对象。

◆ GetLayerCount()

int foxit::ofd::OFDPage::GetLayerCount ( ) const

获取页中层数。

返回
页中层数。

◆ GetPageBox()

RectF foxit::ofd::OFDPage::GetPageBox ( PageBoxType  box_type) const

获取页面区域。

参数
[in]box_type要设置的页面区域类型(值为PageBoxType类型)。
返回
页面区域。坐标系为OFD坐标系。

◆ GetRotation()

common::Rotation foxit::ofd::OFDPage::GetRotation ( ) const

获取页面旋转角度。

返回
页面旋转角度。

◆ GetTemplatePageCount()

int foxit::ofd::OFDPage::GetTemplatePageCount ( ) const

获取页中模板页数。

返回
返回页模板页的数量。

◆ GetTextByLineIndex()

WString foxit::ofd::OFDPage::GetTextByLineIndex ( int  index)

获取指定行的文本内容。

参数
[in]index行索引(由0开始编号)。 有效范围:从0到(count-1)。 count 由函数 OFDPage::GetTextLineCount 返回。
返回
指定行的文本内容。

◆ GetTextLineCount()

int foxit::ofd::OFDPage::GetTextLineCount ( )

获取页面文本行数。

返回
页面文本行数。

◆ InsertLayer()

OFDLayer foxit::ofd::OFDPage::InsertLayer ( int  index)

新建一个层,并插入页中指定位置。

参数
[in]index层索引号(由0开始编号)。
返回
层对象。

◆ InsertPageBlock()

foxit::ofd::graphics::OFDBlockObject foxit::ofd::OFDPage::InsertPageBlock ( int  index)

新建一个页面块。这个接口将创建一个Layer插入到页面,在Layer中添加页面块。

参数
[in]指定层的索引。有效范围:从0到(<i>count</i>-1)。count 由函数 OFDPage::GetLayerCount 返回。
返回
返回页面块句柄。

◆ IsDoubleLayer()

bool foxit::ofd::OFDPage::IsDoubleLayer ( )

判断页面是否为双层页面。

返回
true是双层页面,false不是双层页面。

◆ IsEmpty()

bool foxit::ofd::OFDPage::IsEmpty ( ) const

检查当前对象是否为空。

当前对象为空时,表示当前对象是无用的。

返回
true 表示当前对象为空,false 表示不为空。

◆ IsTemplatePage()

bool foxit::ofd::OFDPage::IsTemplatePage ( ) const

判断当前页面是否为模板页。

返回
true 表示当前页面为模板页,false 表示当前页面不是模板页面。

◆ MaskCharacterWithBlack()

bool foxit::ofd::OFDPage::MaskCharacterWithBlack ( const RectF rect,
int  shape 
)

通过涂黑进行页面信息屏蔽。

参数
[in]rect矩形区域。坐标系为OFD坐标系。
[in]shape0 矩形,1 圆形。
返回
true代表遮盖成功, false代表遮盖失败。

◆ MaskCharacterWithBlur()

bool foxit::ofd::OFDPage::MaskCharacterWithBlur ( const RectF rect,
int  shape,
int  horz_blur,
int  vert_blur 
)

通过模糊进行页面信息屏蔽。

参数
[in]rect矩形区域。坐标系为OFD坐标系。
[in]shape0 矩形,1 圆形。
[in]horz_blur横向高斯模糊,一般取值为32。
[in]vert_blur纵向高斯模糊,一般取值为32。
返回
true代表遮盖成功, false代表遮盖失败。

◆ MaskCharacterWithMosaic()

bool foxit::ofd::OFDPage::MaskCharacterWithMosaic ( const RectF rect,
int  shape,
int  vector_length 
)

通过马赛克进行页面信息屏蔽。

参数
[in]rect矩形区域。坐标系为OFD坐标系。
[in]shape0 矩形,1 圆形。
[in]vector_length马赛克向量长度,一般取值为4。
返回
true代表遮盖成功, false代表遮盖失败。

◆ operator !=()

bool foxit::ofd::OFDPage::operator != ( const OFDPage other) const

不相等操作符。

参数
[in]other另一个OFD页面对象。此函数将检查当前对象是否不等于这个对象。
返回
true 表示不相等,false 表示相等。

◆ operator=()

OFDPage& foxit::ofd::OFDPage::operator= ( const OFDPage other)

赋值操作符。

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

◆ operator==()

bool foxit::ofd::OFDPage::operator== ( const OFDPage other) const

相等操作符。

参数
[in]other另一个OFD页面对象。此函数将检查当前对象是否等于这个对象。
返回
true 表示相等,false 表示不相等。

◆ PreMaskCharacterByRect()

bool foxit::ofd::OFDPage::PreMaskCharacterByRect ( const RectF rect,
foxit::ARGB  color 
)

页面信息预遮盖,可恢复。

参数
[in]rect矩形区域。坐标系为OFD坐标系。
[in]color矩形颜色, ARGB值。
返回
true代表预遮盖成功, false代表预遮盖失败。

◆ RemoveAnnot()

bool foxit::ofd::OFDPage::RemoveAnnot ( int  index)

删除指定索引的标注对象。

参数
[in]index标注索引。有效范围:从0到(count-1)。 count 由函数 OFDPage::GetAnnotCount 返回。
返回
true代表删除成功, false代表删除失败。

◆ RemoveLayer()

bool foxit::ofd::OFDPage::RemoveLayer ( int  index)

删除指定索引的层。

参数
[in]index指定层的索引。有效范围:从0到(count-1)。 count 由函数 OFDPage::GetLayerCount 返回。
返回
true代表删除成功, false代表删除页面失败。

◆ RemovePageBlock()

bool foxit::ofd::OFDPage::RemovePageBlock ( int  index)

删除指定索引页面块。

参数
[in]index指定层的索引。有效范围:从0到(count-1)。 count 由函数 OFDPage::GetLayerCount 返回。
返回
true代表删除页面块成功, false代表删除页面块失败。

◆ ReplaceCharacterBySearch()

bool foxit::ofd::OFDPage::ReplaceCharacterBySearch ( TextSearchCharInfo  char_info,
foxit::uint8  character = 'X' 
)

根据搜索结果,完成字符替换。

参数
[in]char_info搜索文本字符信息对象。
[in]character被屏蔽的信息替换并显示的字符,默认是 'X'。
返回
true代表替换成功, false代表替换失败。

◆ ReplaceCharacterInRect()

bool foxit::ofd::OFDPage::ReplaceCharacterInRect ( const RectF rect,
bool  recover = true,
foxit::uint8  character = 'X' 
)

根据矩形区域,完成字符替换。

参数
[in]rect矩形区域。坐标系为OFD坐标系。
[in]recover被屏蔽的信息是否可恢复,true代表可恢复,false代表不可恢复。
[in]character被屏蔽的信息替换并显示的字符,默认是 'X'。
返回
true代表替换成功, false代表替换失败。

◆ SetPageBox()

bool foxit::ofd::OFDPage::SetPageBox ( PageBoxType  box_type,
const RectF rect 
)

设置页面区域。

参数
[in]box_type要设置的页面区域类型(值为PageBoxType类型)。
[in]rect页面区域值。坐标系为OFD坐标系。
返回
true代表设置成功, false代表设置失败。

◆ SetRotation()

bool foxit::ofd::OFDPage::SetRotation ( common::Rotation  rotate)

设置页面旋转。

参数
[in]rotate旋转角度。
返回
true代表设置成功, false代表设置失败。

◆ SetTemplatePage()

bool foxit::ofd::OFDPage::SetTemplatePage ( OFDPage  template_page,
foxit::ofd::OFDLayer::LayerType  order = foxit::ofd::OFDLayer::e_LayerTypeBody 
)

设置模板页属性。

参数
[in]template_page模板页句柄。
[in]order图层类型。
返回
true代表设置成功, false代表设置失败。

◆ SetTemplatePageByID()

bool foxit::ofd::OFDPage::SetTemplatePageByID ( int  template_id,
foxit::ofd::OFDLayer::LayerType  order = foxit::ofd::OFDLayer::e_LayerTypeBody 
)

根据指定ID,设置页面的模板属性和呈现顺序。

参数
[in]template_id模板页ID。
[in]order模板页的呈现顺序,0:背景层(默认)1:正文层 2:前景层。
返回
true代表设置成功, false代表设置失败。