Foxit PDF SDK
fs_ofdpage.h
1 #ifndef FS_OFD_PAGE_H_
2 #define FS_OFD_PAGE_H_
3 
4 #include "common/fs_common.h"
5 #include "fs_ofdlayer.h"
6 #include "annots/fs_ofdannot.h"
7 
13 namespace foxit {
17 namespace ofd {
18 namespace graphics {
19 class OFDBlockObject;
20 }
21 class Actions;
22 class TextSearchCharInfo;
23 class TextSearch;
24 class Annot;
25 
27 class OFDPage : public Base {
28  public:
34  typedef enum _PageBoxType {
45  } PageBoxType;
46 
47 
49  ~OFDPage();
50 
56  OFDPage(const OFDPage& other);
57 
65  OFDPage& operator = (const OFDPage& other);
66 
74  bool operator == (const OFDPage& other) const;
75 
83  bool operator != (const OFDPage& other) const;
84 
92  bool IsEmpty() const;
93 
99  bool IsTemplatePage() const;
100 
106  int GetIndex() const;
107 
113  int GetID() const;
114 
126  Matrix GetDisplayMatrix(int left, int top, int width, int height, common::Rotation rotate) const;
127 
136  bool SetPageBox(PageBoxType box_type, const RectF& rect);
137 
145  bool SetRotation(common::Rotation rotate);
146 
153 
161  RectF GetPageBox(PageBoxType box_type) const;
162 
168  Actions GetActions() const;
169 
179 
189 
195  int GetTemplatePageCount() const;
196 
202  OFDLayer AddLayer();
203 
211  OFDLayer InsertLayer(int index);
212 
221  bool RemoveLayer(int index);
222 
228  int GetLayerCount() const;
229 
238  OFDLayer GetLayer(int index) const;
239 
246 
256 
265  bool RemovePageBlock(int index);
266 
275  bool ReplaceCharacterBySearch(TextSearchCharInfo char_info, foxit::uint8 character = 'X');
276 
286  bool ReplaceCharacterInRect(const RectF& rect, bool recover = true, foxit::uint8 character = 'X');
287 
296  bool MaskCharacterWithBlack(const RectF& rect, int shape);
297 
308  bool MaskCharacterWithBlur(const RectF& rect, int shape, int horz_blur, int vert_blur);
309 
319  bool MaskCharacterWithMosaic(const RectF& rect, int shape, int vector_length);
320 
329  bool PreMaskCharacterByRect(const RectF& rect, foxit::ARGB color);
330 
339  bool FillRect(const RectF& rect, foxit::RGB color);
340 
346  int GetTextLineCount();
347 
356  WString GetTextByLineIndex(int index);
357 
363  int GetAnnotCount();
364 
373  Annot GetAnnot(int index);
374 
383 
392  bool RemoveAnnot(int index);
393 
403 
409  bool IsDoubleLayer();
410 
411  explicit OFDPage(FS_HANDLE handle);
412 };
413 
415 class OFDTemplatePage FS_FINAL : public OFDPage {
416  public:
419 
427  bool SetName(const WString& name);
428 
429  explicit OFDTemplatePage(FS_HANDLE handle);
430 };
431 
432 } // namespace ofd
433 } // namespace foxit
434 
435 #endif // FS_OFD_PAGE_H_
bool RemoveAnnot(int index)
删除指定索引的标注对象。
RectF GetPageBox(PageBoxType box_type) const
获取页面区域。
裁剪区域。
Definition: fs_ofdpage.h:44
int GetIndex() const
获取页索引。
物理区域。
Definition: fs_ofdpage.h:38
Matrix GetDisplayMatrix(int left, int top, int width, int height, common::Rotation rotate) const
计算渲染矩阵。
Annot GetAnnot(int index)
按索引获取标注对象。
FX_UINT8 uint8
无符号 8 位整数。
Definition: fs_basictypes.h:203
bool SetRotation(common::Rotation rotate)
设置页面旋转。
uint32 RGB
RGB 颜色类型,24 位,((b) | ((g) << 8) | ((r) << 16)))
Definition: fs_basictypes.h:211
bool IsTemplatePage() const
判断当前页面是否为模板页。
OFDPage(const OFDPage &other)
构造函数,通过另一个OFD页面对象。
宽字符串类
Definition: fx_string.h:1457
foxit::ofd::graphics::OFDBlockObject AddPageBlock()
新建一个页面块。这个接口将创建一个Layer插入到页面,在Layer中添加页面块。
bool ReplaceCharacterInRect(const RectF &rect, bool recover=true, foxit::uint8 character='X')
根据矩形区域,完成字符替换。
common::Rotation GetRotation() const
获取页面旋转角度。
Actions GetActions() const
获取页面动作数组。
AnnotType
OFD标注类型定义枚举类型.
Definition: fs_ofdannot.h:26
OFDLayer GetLayer(int index) const
获取指定索引的层句柄。
uint32 ARGB
ARGB 颜色类型,32 位,((b) | ((g) << 8) | ((r) << 16)) | ((a) << 24)
Definition: fs_basictypes.h:209
OFDLayer InsertLayer(int index)
新建一个层,并插入页中指定位置。
OFDPage & operator=(const OFDPage &other)
赋值操作符。
Annot AddAnnot(Annot::AnnotType type)
新建一个标注对象并添加到页中。
~OFDTemplatePage()
析构函数。
bool MaskCharacterWithMosaic(const RectF &rect, int shape, int vector_length)
通过马赛克进行页面信息屏蔽。
OFDLayer AddLayer()
新建一个层,并追加至页中。
Definition: fs_ofdaction.h:679
bool MaskCharacterWithBlur(const RectF &rect, int shape, int horz_blur, int vert_blur)
通过模糊进行页面信息屏蔽。
~OFDPage()
析构函数。
foxit::ofd::graphics::OFDBlockObject InsertPageBlock(int index)
新建一个页面块。这个接口将创建一个Layer插入到页面,在Layer中添加页面块。
int GetID() const
获取页ID。
int GetAnnotCount()
获取页中标注数量。
Definition: fs_ofdannot.h:19
bool RemovePageBlock(int index)
删除指定索引页面块。
bool SetPageBox(PageBoxType box_type, const RectF &rect)
设置页面区域。
Definition: fs_ofdblockobject.h:21
Annot GetAnnotByID(foxit::uint32 id)
按ID获取标注对象。
FX_UINT32 uint32
无符号 32 位整数。
Definition: fs_basictypes.h:195
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:213
bool FillRect(const RectF &rect, foxit::RGB color)
将指定区域填充为指定颜色。
通用定义和类的头文件。
int GetTextLineCount()
获取页面文本行数。
bool operator !=(const OFDPage &other) const
不相等操作符。
Definition: fs_ofdpage.h:415
int GetTemplatePageCount() const
获取页中模板页数。
bool ReplaceCharacterBySearch(TextSearchCharInfo char_info, foxit::uint8 character='X')
根据搜索结果,完成字符替换。
bool IsEmpty() const
检查当前对象是否为空。
Definition: fs_basictypes.h:465
bool SetTemplatePageByID(int template_id, foxit::ofd::OFDLayer::LayerType order=foxit::ofd::OFDLayer::e_LayerTypeBody)
根据指定ID,设置页面的模板属性和呈现顺序。
bool SetName(const WString &name)
设置模板页的名称。
PageBoxType
OFD页面区域类型枚举。
Definition: fs_ofdpage.h:34
Rotation
旋转的枚举。
Definition: fs_common.h:57
Foxit命名空间。
Definition: fs_pdf3d.h:26
出血框,超出物理设备限制的额外出血区域,默认为物理区域。
Definition: fs_ofdpage.h:36
LayerType
OFD页面层类型枚举。
Definition: fs_ofdlayer.h:38
Definition: fs_ofdpage.h:27
bool RemoveLayer(int index)
删除指定索引的层。
显示区域,页面内容实际显示或打印输出区域。
Definition: fs_ofdpage.h:40
bool operator==(const OFDPage &other) const
相等操作符。
Definition: fs_ofdtextsearch.h:124
Definition: fx_coordinates.h:1076
Definition: fs_ofdlayer.h:31
int GetLayerCount() const
获取页中层数。
正文层。
Definition: fs_ofdlayer.h:42
bool SetTemplatePage(OFDPage template_page, foxit::ofd::OFDLayer::LayerType order=foxit::ofd::OFDLayer::e_LayerTypeBody)
设置模板页属性。
WString GetTextByLineIndex(int index)
获取指定行的文本内容。
bool IsDoubleLayer()
判断页面是否为双层页面。
bool MaskCharacterWithBlack(const RectF &rect, int shape)
通过涂黑进行页面信息屏蔽。
版心区域即文件正文区域。
Definition: fs_ofdpage.h:42
bool PreMaskCharacterByRect(const RectF &rect, foxit::ARGB color)
页面信息预遮盖,可恢复。
Definition: fx_coordinates.h:771