Foxit PDF SDK
fs_ofdtextpage.h
1 #ifndef FS_OFD_TEXTPAGE_H_
2 #define FS_OFD_TEXTPAGE_H_
3 
4 #include "common/fs_common.h"
5 
11 namespace foxit {
15 namespace ofd {
16 class OFDPage;
17 
19 class TextPageCharInfo FS_FINAL : public Object {
20  public:
29  rect(rect),
32 
39  this->rect = other.rect;
40  this->char_code = other.char_code;
41  this->text_object_id = other.text_object_id;
42  }
43 
52  this->rect = other.rect;
53  this->char_code = other.char_code;
54  this->text_object_id = other.text_object_id;
55  return *this;
56  }
57 
68  this->rect = rect;
69  this->char_code = char_code;
70  this->text_object_id = text_object_id;
71  }
72 
77 
82 
87 };
88 
90 class TextPage FS_FINAL : public Base {
91  public:
97  explicit TextPage(OFDPage page);
98 
100  ~TextPage();
101 
107  TextPage(const TextPage& other);
108 
116  TextPage& operator = (const TextPage& other);
117 
125  bool operator == (const TextPage& other) const;
126 
134  bool operator != (const TextPage& other) const;
135 
143  bool IsEmpty() const;
144 
150  int GetCharInfoCount();
151 
160  TextPageCharInfo GetCharInfo(int index);
161 
171  int GetCharIndexAtPos(float x_pos, float y_pos, float tolerance);
172 
183  String GetText(int start_index, int count);
184 
192  bool ExportToFile(const String& file_path);
193 
201  bool ExportToFile(const WString& file_path);
202 
211 
212  explicit TextPage(FS_HANDLE handle);
213 };
214 
216 class TextPageSelect FS_FINAL : public Base {
217  public:
223  typedef enum _TextSelectMode {
228  } TextSelectMode;
229 
230 
236  explicit TextPageSelect(OFDPage page);
237 
239  ~TextPageSelect();
240 
246  TextPageSelect(const TextPageSelect& other);
247 
256 
264  bool operator == (const TextPageSelect& other) const;
265 
273  bool operator != (const TextPageSelect& other) const;
274 
282  bool IsEmpty() const;
283 
289  int GetTextIDCount();
290 
299  int GetTextID(int index);
300 
306  String GetText();
307 
313  int GetRectCount();
314 
323  foxit::RectF GetRect(int index);
324 
333  void SetMode(TextSelectMode mode);
334 
343  void SetRange(foxit::PointF start_point, foxit::PointF end_point);
344 
345  explicit TextPageSelect(FS_HANDLE handle);
346 };
347 
348 } // namespace ofd
349 } // namespace foxit
350 
351 #endif // FS_OFD_TEXTPAGE_H_
bool operator !=(const TextPageSelect &other) const
不相等操作符。
int GetTextIDCount()
获取文本ID数量。
文件写入接口。
Definition: fx_stream.h:470
模式类型:矩形选择。
Definition: fs_ofdtextpage.h:225
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:220
Definition: fs_ofdtextpage.h:19
foxit::RectF GetRect(int index)
获取指定索引的矩形。
bool operator !=(const TextPage &other) const
不相等操作符。
TextPageCharInfo GetCharInfo(int index)
获取指定索引的字符信息。
Definition: fx_coordinates.h:30
bool ExportToFile(const String &file_path)
将文本内容导出到文件中。
TextPage & operator=(const TextPage &other)
赋值操作符。
宽字符串类
Definition: fx_string.h:1457
~TextPage()
析构函数。
int GetCharIndexAtPos(float x_pos, float y_pos, float tolerance)
获取指定位置的字符索引。
bool operator==(const TextPage &other) const
相等操作符。
bool IsEmpty() const
检查当前对象是否为空。
TextPageSelect & operator=(const TextPageSelect &other)
赋值操作符。
String GetText()
获取文本内容。
TextPage(OFDPage page)
带参数的构造函数。
int GetRectCount()
获取矩形数量。
Definition: fs_ofdtextpage.h:216
TextPageCharInfo & operator=(const TextPageCharInfo &other)
赋值操作符。
Definition: fs_ofdtextpage.h:51
FX_UINT32 uint32
无符号 32 位整数。
Definition: fs_basictypes.h:195
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:213
通用定义和类的头文件。
Definition: fs_ofdtextpage.h:90
int GetCharInfoCount()
获取字符信息数量。
Definition: fs_basictypes.h:465
String GetText(int start_index, int count)
获取文本内容。
foxit::RectF rect
字符的边界矩形。
Definition: fs_ofdtextpage.h:76
foxit::uint32 text_object_id
字符所属的文本对象ID。
Definition: fs_ofdtextpage.h:86
void SetRange(foxit::PointF start_point, foxit::PointF end_point)
设置选择范围。
void SetMode(TextSelectMode mode)
设置选择模式。
TextSelectMode
OFD文本选择模式定义枚举类型。
Definition: fs_ofdtextpage.h:223
foxit::uint32 char_code
字符的Unicode编码。
Definition: fs_ofdtextpage.h:81
Foxit命名空间。
Definition: fs_taggedpdf.h:27
int GetTextID(int index)
获取指定索引的文本ID。
字节字符串类
Definition: fx_string.h:317
Definition: fs_ofdpage.h:27
~TextPageSelect()
析构函数。
TextPageSelect(OFDPage page)
带参数的构造函数。
TextPageCharInfo(const foxit::RectF &rect, foxit::uint32 char_code, foxit::uint32 text_object_id)
带参数的构造函数。
Definition: fs_ofdtextpage.h:28
bool IsEmpty() const
检查当前对象是否为空。
void Set(const foxit::RectF &rect, foxit::uint32 char_code, foxit::uint32 text_object_id)
设置值。
Definition: fs_ofdtextpage.h:67
bool operator==(const TextPageSelect &other) const
相等操作符。
TextPageCharInfo(const TextPageCharInfo &other)
构造函数,通过另一个OFD文本页面字符信息对象。
Definition: fs_ofdtextpage.h:38
模式类型:段落选择。
Definition: fs_ofdtextpage.h:227
Definition: fx_coordinates.h:771