ArkoPDF
← SDK API リファレンス

ipdf_pagetext.h

页面文本:文本的读取与定位。

インターフェースの説明はヘッダーの英語原文のままにしています。読んでいるコードと突き合わせやすくするためです。

定数

シグネチャValueDescription
PDFFIND_MATCHCASE0x00000001Whether to match the character case(upper or lower).
PDFFIND_MATCHWHOLEWORD0x00000002Whether to match the whole word.
PDFFIND_CONSECUTIVE0x00000004Whether to do consecutive searching.

class IPDF_PageText

PDF Text Page Interface.

メソッド(26)

シグネチャ説明
Release()Release the PDF texgt page.
GetAllText(char* in_out_buf, int* in_out_buflen)Get all text in a page.
GetAllText_Unicode(wchar_t* in_out_buf, int* in_out_buflen)Unicode version for getting all text in a page.
ParseText()Parse page text.
IsParsed()Test whether the page text is parsed.
CountChars()Count characters in a page.
GetCaret(const PDSDK_FloatPoint* point, float xTorelance, float yTore…)Get text caret index at specificed point.
GetCaretPos(int caret, PDSDK_FloatPoint* top, PDSDK_FloatPoint* bottom)Get text caret position.
GetNextCaret(int caret, int direct)Get next text caret.
GetSelectedChars(int caret_start, int caret_end)Get selected text.
GetSelCharUTF8(int caret_start, int caret_end)UTF8 version for getting selected text.
CountSelectedCharBox(int caret_start, int caret_end)Count the selected text's rectangle.
GetSelectedCharBox(int index, PDSDK_FloatRect* rect)Get selected text's rectangle.
GetTextByRect(const PDSDK_FloatRect* rect)Get text in specificed rectangle.
GetTextByRectUTF8(const PDSDK_FloatRect* rect)Get text in specificed rectangle.
GetWordBreak(int caret, int direction)Not support now.
FindFirst(const wchar_t* find_what, int find_flag, int start_pos = 0)Find the first match with specified find flags, optionally with a start position..
FindNext()Find the next match.
FindPrev()Find the previous match.
GetCurFindOrder()Get the current order.
GetMatchedCount()Get the count of current matches.
GetMatchedTextRectCount()Get the count of rectangle of current matches.
GetMatchedTextRect(int index, PDSDK_FloatRect* rect)Get matched text's rectangle by specified index.
GetTextAbstract(int start, int count)Get text line which contain the match.
GetTextAbstract_Unicode(int start, int count)Get text line which contain the match(Unicode version).
GetWordAt(int caret, int& iStart, int& iEnd)Get the word which contain the specified text caret.
GetAllText
int GetAllText(char* in_out_buf, int* in_out_buflen) = 0;

Get all text in a page.

パラメータ

  • in_out_buf(in/out) — A buffer to receiv the text.
  • in_out_buflen(in/out) — Length of in_out_buf buffer.

戻り値:1 for success, 0 for failure.

GetAllText_Unicode
int GetAllText_Unicode(wchar_t* in_out_buf, int* in_out_buflen) = 0;

Unicode version for getting all text in a page.

パラメータ

  • in_out_buf(in/out) — A buffer to receiv the text.
  • in_out_buflen(in/out) — Length of in_out_buf buffer.

戻り値:1 for success, 0 for failure.

ParseText
int ParseText() = 0;

Parse page text.

戻り値:1 for success, 0 for failure.

IsParsed
int IsParsed() = 0;

Test whether the page text is parsed.

戻り値:1 for parsed, 0 for not parsed.

CountChars
int CountChars() = 0;

Count characters in a page.

戻り値:The total number of characters in a page.

GetCaret
int GetCaret(const PDSDK_FloatPoint* point, float xTorelance, float yTorelance) = 0;

Get text caret index at specificed point.

パラメータ

  • point(in) — The point in user space.
  • xTorelance(in) — X-direction torelance.
  • yTorelance(in) — Y-direction torelance.

戻り値:The zero-based caret index. Less than zero means no character at specificed point.

GetCaretPos
int GetCaretPos(int caret, PDSDK_FloatPoint* top, PDSDK_FloatPoint* bottom) = 0;

Get text caret position.

パラメータ

  • caret(in) — The caret index.
  • top(out) — Top point in user space.
  • bottom(out) — Bottom point in user space.

戻り値:1 for success, 0 for failure.

GetNextCaret
int GetNextCaret(int caret, int direct) = 0;

Get next text caret.

パラメータ

  • caret(in) — The caret index.
  • direct(in) — The direction for next caret. @see Caret direction flags

戻り値:The next caret index, less 0 means no caret.

GetSelectedChars
const wchar_t* GetSelectedChars(int caret_start, int caret_end) = 0;

Get selected text.

パラメータ

  • caret_start(in) — The start caret of selected chars.
  • caret_end(out) — The end caret of selected chars.

戻り値:The selected char's unicodes.

GetSelCharUTF8
const char* GetSelCharUTF8(int caret_start, int caret_end) = 0;

UTF8 version for getting selected text.

パラメータ

  • caret_start(in) — The start caret of selected chars.
  • caret_end(in) — The end caret of selected chars.

戻り値:The selected char's utf8.

CountSelectedCharBox
int CountSelectedCharBox(int caret_start, int caret_end) = 0;

Count the selected text's rectangle.

パラメータ

  • caret_start(in) — The start caret of selected chars.
  • caret_end(in) — The end caret of selected chars.

戻り値:The number of rectangles whitch used to hilight.

GetSelectedCharBox
int GetSelectedCharBox(int index, PDSDK_FloatRect* rect) = 0;

Get selected text's rectangle.

パラメータ

  • index(in) — The zero-based rectangle index, range is 0 to CountSelectedCharBox()-1.
  • rect(in) — The rectangle of specificed caret.

戻り値:1 for success, 0 for failure.

GetTextByRect
const wchar_t* GetTextByRect(const PDSDK_FloatRect* rect) = 0;

Get text in specificed rectangle.

パラメータ

  • rect(in) — The rectangle.

戻り値:The selected unicodes.

GetTextByRectUTF8
const char* GetTextByRectUTF8(const PDSDK_FloatRect* rect) = 0;

Get text in specificed rectangle.

パラメータ

  • rect(in) — The rectangle.

戻り値:The selected utf8s.

FindFirst
int FindFirst(const wchar_t* find_what, int find_flag, int start_pos = 0) = 0;

Find the first match with specified find flags, optionally with a start position..

パラメータ

  • find_what(in) — The word to be matched.
  • find_flag(in) — The find flags. @see Find flags.
  • start_pos(in) — The find start position, an zero-based position.

戻り値:1 for success, 0 for failure.

FindNext
int FindNext() = 0;

Find the next match.

戻り値:1 for success, 0 for failure.

FindPrev
int FindPrev() = 0;

Find the previous match.

戻り値:1 for success, 0 for failure.

GetMatchedTextRect
void GetMatchedTextRect(int index, PDSDK_FloatRect* rect) = 0;

Get matched text's rectangle by specified index.

パラメータ

  • index(in) — The zero-based rectangle index. Range is from 0 to GetMatchedTextRectCount().
  • rect(out) — Receiv the rectangle.
GetTextAbstract
const char* GetTextAbstract(int start, int count) = 0;

Get text line which contain the match.

パラメータ

  • start(in) — The first char order of match.
  • count(in) — The count of match.

戻り値:The text line of specified match.

GetTextAbstract_Unicode
const wchar_t* GetTextAbstract_Unicode(int start, int count) = 0;

Get text line which contain the match(Unicode version).

パラメータ

  • start(in) — The first char order of match.
  • count(in) — The count of match.

戻り値:The text line of specified match.

GetWordAt
const wchar_t* GetWordAt(int caret, int& iStart, int& iEnd) = 0;

Get the word which contain the specified text caret.

パラメータ

  • caret(in) — The text caret index.
  • iStart(out) — The start caret of word.
  • iEnd(out) — The end caret of word.

戻り値:The word's unicodes.