ipdf_pagetext.h
页面文本:文本的读取与定位。
Les descriptions d'interface restent en anglais, telles quelles dans les en-têtes : vous pouvez les comparer directement au code.
Constantes
| Signature | Value | Description |
|---|---|---|
| PDFFIND_MATCHCASE | 0x00000001 | Whether to match the character case(upper or lower). |
| PDFFIND_MATCHWHOLEWORD | 0x00000002 | Whether to match the whole word. |
| PDFFIND_CONSECUTIVE | 0x00000004 | Whether to do consecutive searching. |
class IPDF_PageText
PDF Text Page Interface.
Méthodes(26)
| Signature | Description |
|---|---|
| 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.
Paramètres
in_out_buf(in/out) — A buffer to receiv the text.in_out_buflen(in/out) — Length of in_out_buf buffer.
Retour: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.
Paramètres
in_out_buf(in/out) — A buffer to receiv the text.in_out_buflen(in/out) — Length of in_out_buf buffer.
Retour:1 for success, 0 for failure.
ParseText
int ParseText() = 0;
Parse page text.
Retour:1 for success, 0 for failure.
IsParsed
int IsParsed() = 0;
Test whether the page text is parsed.
Retour:1 for parsed, 0 for not parsed.
CountChars
int CountChars() = 0;
Count characters in a page.
Retour: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.
Paramètres
point(in) — The point in user space.xTorelance(in) — X-direction torelance.yTorelance(in) — Y-direction torelance.
Retour: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.
Paramètres
caret(in) — The caret index.top(out) — Top point in user space.bottom(out) — Bottom point in user space.
Retour:1 for success, 0 for failure.
GetNextCaret
int GetNextCaret(int caret, int direct) = 0;
Get next text caret.
Paramètres
caret(in) — The caret index.direct(in) — The direction for next caret. @see Caret direction flags
Retour:The next caret index, less 0 means no caret.
GetSelectedChars
const wchar_t* GetSelectedChars(int caret_start, int caret_end) = 0;
Get selected text.
Paramètres
caret_start(in) — The start caret of selected chars.caret_end(out) — The end caret of selected chars.
Retour:The selected char's unicodes.
GetSelCharUTF8
const char* GetSelCharUTF8(int caret_start, int caret_end) = 0;
UTF8 version for getting selected text.
Paramètres
caret_start(in) — The start caret of selected chars.caret_end(in) — The end caret of selected chars.
Retour:The selected char's utf8.
CountSelectedCharBox
int CountSelectedCharBox(int caret_start, int caret_end) = 0;
Count the selected text's rectangle.
Paramètres
caret_start(in) — The start caret of selected chars.caret_end(in) — The end caret of selected chars.
Retour:The number of rectangles whitch used to hilight.
GetSelectedCharBox
int GetSelectedCharBox(int index, PDSDK_FloatRect* rect) = 0;
Get selected text's rectangle.
Paramètres
index(in) — The zero-based rectangle index, range is 0 to CountSelectedCharBox()-1.rect(in) — The rectangle of specificed caret.
Retour:1 for success, 0 for failure.
GetTextByRect
const wchar_t* GetTextByRect(const PDSDK_FloatRect* rect) = 0;
Get text in specificed rectangle.
Paramètres
rect(in) — The rectangle.
Retour:The selected unicodes.
GetTextByRectUTF8
const char* GetTextByRectUTF8(const PDSDK_FloatRect* rect) = 0;
Get text in specificed rectangle.
Paramètres
rect(in) — The rectangle.
Retour: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..
Paramètres
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.
Retour:1 for success, 0 for failure.
FindNext
int FindNext() = 0;
Find the next match.
Retour:1 for success, 0 for failure.
FindPrev
int FindPrev() = 0;
Find the previous match.
Retour:1 for success, 0 for failure.
GetMatchedTextRect
void GetMatchedTextRect(int index, PDSDK_FloatRect* rect) = 0;
Get matched text's rectangle by specified index.
Paramètres
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.
Paramètres
start(in) — The first char order of match.count(in) — The count of match.
Retour: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).
Paramètres
start(in) — The first char order of match.count(in) — The count of match.
Retour: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.
Paramètres
caret(in) — The text caret index.iStart(out) — The start caret of word.iEnd(out) — The end caret of word.
Retour:The word's unicodes.