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

Public 成员函数

 TextPage (OFDPage page)
 带参数的构造函数。 更多...
 
 TextPage (const TextPage &other)
 构造函数,通过另一个OFD文本页面对象。 更多...
 
 ~TextPage ()
 析构函数。
 
bool ExportToFile (const String &file_path)
 将文本内容导出到文件中。 更多...
 
bool ExportToFile (const WString &file_path)
 将文本内容导出到文件中。 更多...
 
bool ExportToFile (foxit::common::file::WriterCallback *file_writer)
 将文本内容导出到文件中。 更多...
 
int GetCharIndexAtPos (float x_pos, float y_pos, float tolerance)
 获取指定位置的字符索引。 更多...
 
TextPageCharInfo GetCharInfo (int index)
 获取指定索引的字符信息。 更多...
 
int GetCharInfoCount ()
 获取字符信息数量。 更多...
 
String GetText (int start_index, int count)
 获取文本内容。 更多...
 
bool IsEmpty () const
 检查当前对象是否为空。 更多...
 
bool operator != (const TextPage &other) const
 不相等操作符。 更多...
 
TextPageoperator= (const TextPage &other)
 赋值操作符。 更多...
 
bool operator== (const TextPage &other) const
 相等操作符。 更多...
 
- Public 成员函数 继承自 foxit::Base
FS_HANDLE Handle () const
 获取当前对象的句柄。 更多...
 

详细描述

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

构造及析构函数说明

◆ TextPage() [1/2]

foxit::ofd::TextPage::TextPage ( OFDPage  page)
explicit

带参数的构造函数。

参数
[in]page页面对象。

◆ TextPage() [2/2]

foxit::ofd::TextPage::TextPage ( const TextPage other)

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

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

成员函数说明

◆ ExportToFile() [1/3]

bool foxit::ofd::TextPage::ExportToFile ( const String file_path)

将文本内容导出到文件中。

参数
[in]file_path导出文本内容的文件路径。
返回
true表示导出成功,false表示导出失败。

◆ ExportToFile() [2/3]

bool foxit::ofd::TextPage::ExportToFile ( const WString file_path)

将文本内容导出到文件中。

参数
[in]file_path导出文本内容的文件路径。
返回
true表示导出成功,false表示导出失败。

◆ ExportToFile() [3/3]

bool foxit::ofd::TextPage::ExportToFile ( foxit::common::file::WriterCallback file_writer)

将文本内容导出到文件中。

参数
[in]file_writer用户实现的 common::file::WriterCallback 对象,用于保存文本内容。
返回
true表示导出成功,false表示导出失败。

◆ GetCharIndexAtPos()

int foxit::ofd::TextPage::GetCharIndexAtPos ( float  x_pos,
float  y_pos,
float  tolerance 
)

获取指定位置的字符索引。

参数
[in]x_pos字符的X坐标位置。
[in]y_pos字符的Y坐标位置。
[in]tolerance坐标容差值。
返回
指定位置的字符索引,若未找到则返回-1。

◆ GetCharInfo()

TextPageCharInfo foxit::ofd::TextPage::GetCharInfo ( int  index)

获取指定索引的字符信息。

参数
[in]index字符信息索引号。有效范围:从0到(count-1)。 count 由函数 foxit::ofd::TextPage::GetCharInfoCount 返回。
返回
指定索引的字符信息。

◆ GetCharInfoCount()

int foxit::ofd::TextPage::GetCharInfoCount ( )

获取字符信息数量。

返回
字符信息数量。

◆ GetText()

String foxit::ofd::TextPage::GetText ( int  start_index,
int  count 
)

获取文本内容。

参数
[in]start_index文本内容的起始字符索引。有效范围:从0到(count-1)。 count 由函数 foxit::ofd::TextPage::GetCharInfoCount 返回。
[in]count文本内容的字符数量。有效范围:从0到(count-start_index)。 count 由函数 foxit::ofd::TextPage::GetCharInfoCount 返回。
返回
文本内容。

◆ IsEmpty()

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

检查当前对象是否为空。

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

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

◆ operator !=()

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

不相等操作符。

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

◆ operator=()

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

赋值操作符。

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

◆ operator==()

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

相等操作符。

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