ipdf_paragraph.h
段落:把页面文字识别为可编辑段落,读写文字与字符属性。
介面說明保留標頭檔裡的英文原文 —— 照文件寫程式時要能一眼對上程式碼裡的註解。
常數
| 簽章 | Value | Description |
|---|---|---|
| PARA_ALIGN_NONE | -1 | Align None |
| PARA_ALIGN_LEFT | 0 | Align left |
| PARA_ALIGN_CENTER | 1 | Align center |
| PARA_ALIGN_RIGHT | 2 | Align right |
| PARA_ALIGN_ADJUST | 3 | Align adjust |
| SCRIPT_NORMAL | 0 | Normal text |
| SCRIPT_SUPPER | 1 | Supper script |
| SCRIPT_SUB | 2 | Sub script |
| PDSDK_PARA_UNDOTYPE_DELETEPARA | 0 | Delete paragraph. For IPDF_Paragraph::DeleteParagraph(). |
| PDSDK_PARA_UNDOTYPE_INSERTTEXT | 1 | Insert text. For IPDF_Paragraph::InsertText(). |
| PDSDK_PARA_UNDOTYPE_DELETETEXT | 2 | Delete text. For IPDF_Paragraph::DeleteText(). |
| PDSDK_PARA_UNDOTYPE_FONT | 3 | Set font. For IPDF_Paragraph::SetFont(). |
| PDSDK_PARA_UNDOTYPE_FONTSIZE | 4 | Set font size. For IPDF_Paragraph::SetFontSize(). |
| PDSDK_PARA_UNDOTYPE_COLOR | 5 | Set text color. For IPDF_Paragraph::SetTextColor(). |
| PDSDK_PARA_UNDOTYPE_BOLD | 6 | Set bold. For IPDF_Paragraph::SetBold(). |
| PDSDK_PARA_UNDOTYPE_ITALIC | 7 | Set italic. For IPDF_Paragraph::SetItalic(). |
| PDSDK_PARA_UNDOTYPE_UNDERLINE | 8 | Set under line. For IPDF_Paragraph::SetUnderline(). |
| PDSDK_PARA_UNDOTYPE_STRIKEOUT | 9 | Set strikout. For IPDF_Paragraph::SetStrikeout(). |
| PDSDK_PARA_UNDOTYPE_SUPPERSCRIPT | 10 | Set supper script. For IPDF_Paragraph::SetScript(). |
| PDSDK_PARA_UNDOTYPE_SUBSCRIPT | 11 | Set subscript. For IPDF_Paragraph::SetScript(). |
| PDSDK_PARA_UNDOTYPE_NOSCRIPT | 12 | Set no scriopt. For IPDF_Paragraph::SetScript(). |
| PDSDK_PARA_UNDOTYPE_CHARSPACE | 13 | Set char space. For IPDF_Paragraph::SetCharSpace(). |
| PDSDK_PARA_UNDOTYPE_WORDSPACE | 14 | Set word space. For IPDF_Paragraph::SetWordSpace(). |
| PDSDK_PARA_UNDOTYPE_LINESPACE | 15 | Set line space. For IPDF_Paragraph::SetLineSpace(). |
| PDSDK_PARA_UNDOTYPE_ALIGN | 16 | Set align. For IPDF_Paragraph::SetAlign(). |
| PDSDK_PARA_UNDOTYPE_INSERTRETURN | 17 | Insert return. For IPDF_Paragraph::DeleteText(). |
| PDSDK_PARA_UNDOTYPE_OFFSETPARA | 18 | Offset paragraph. For IPDF_Paragraph::OffsetParagraph(). |
| PDSDK_PARA_UNDOTYPE_REPLACETEXT | 19 | Repalce text. For IPDF_Paragraph::ReplaceTexts(). |
| PDSDK_PARA_UNDOTYPE_RESIZEWIDTH | 20 | Resize paragraph width. For IPDF_Paragraph::ResizeWidth(). |
class IPDF_Paragraph
方法(66)
| 簽章 | 說明 |
|---|---|
| GetBBox(PDSDK_FloatBox* box) | Get the bounding box of paragraph. |
| IsRotate() | Test whether the paragraph is rotated. |
| IsVerticalWrittingMode() | Test whether the paragraph is vertical writting mode. |
| GetText(int start_caret, int end_caret) | Get the text of specified range in paragraph. |
| GetText_UTF8(int start_caret, int end_caret) | Get the text of specified range in paragraph. |
| GetCurrentCaret() | Get currernt caret after paragraph modify. When some text changed, such as rest text color,reset font, insert or delete text, the current caret should be changed, so must re-load it. |
| GetCurCaretRange(int* start_caret, int* end_caret) | Get currernt selection range after paragraph modify. When some text changed, such as rest text color,reset font, insert or delete text, the current caret should be changed, so must re-load it. |
| GetCaretAt(const PDSDK_FloatPoint* point) | Get caret by point. |
| GetCaretPos(int caret, PDSDK_FloatPoint* top, PDSDK_FloatPoint* bottom) | Get text caret position. |
| GetNextCaret(int caret, int direct) | Get next text caret. |
| CountCarets() | Count total number of carets in paragraph. |
| IsHeaderCaret(int caret) | Test whether is the first caret of the paragraph. |
| IsTailCaret(int caret) | Test whether is the tail caret of the paragraph. |
| GetLineHeaderCaret(int caret) | Test whether is the first caret of a text line. |
| GetLineTailCaret(int caret) | Test whether is the tail caret of a text line. |
| CountSelBox(int start_caret, int end_caret) | Count the box number of selected text in paragraph. |
| GetSelBox(int index, PDSDK_FloatBox* box) | Get the boxies of selected text in paragraph. |
| InsertText(int caret, IPDF_Font* font, float font_size, unsigned int co…) | Insert text at the position specified by caret. |
| InsertText(int caret, IPDF_Font* font, float font_size, unsigned int co…) | UTF8 version for InsertText. |
| DeleteText(int start_caret, int end_caret, IPDF_ParaUndoItem* pUndoItem) | Delete text in paragraph. |
| BackSpaceAt(int caret, IPDF_ParaUndoItem* pUndoItem) | Do backspace event. |
| InsertReturn(int caret, IPDF_ParaUndoItem* pUndoItem) | Insert return flag to start a new line. |
| SetStroke(int start_caret, int end_caret, int isStroke, unsigned int s…) | Set stroke color to selected texts. |
| SetTextColor(int start_caret, int end_caret, unsigned int color, IPDF_Par…) | Set text color (fill color) to selected texts. |
| SetFont(int start_caret, int end_caret, IPDF_Font* font, IPDF_ParaUn…) | Set font to selected texts. |
| SetFontSize(int start_caret, int end_caret, float font_size, IPDF_ParaUn…) | Set font size to selected texts. |
| SetItalic(int start_caret, int end_caret, IPDF_ParaUndoItem* pUndoItem) | Set italic style to selected texts. |
| SetBold(int start_caret, int end_caret, IPDF_ParaUndoItem* pUndoItem) | Set bold style to selected texts. |
| SetUnderline(int start_caret, int end_caret, IPDF_ParaUndoItem* pUndoItem) | Set underline to selected texts. |
| SetStrikeout(int start_caret, int end_caret, IPDF_ParaUndoItem* pUndoItem) | Set strikout line to selected texts. |
| SetScript(int start_caret, int end_caret, int nScript, IPDF_ParaUndoIt…) | Set script style to selected texts. |
| IsBold(int caret) | Test whether the text is bold. |
| IsItalic(int caret) | Test whether the text is italic. |
| IsUnderline(int caret) | Test whether the text is underline style. |
| IsStrikeout(int caret) | Test whether the text is strikout style. |
| IsSupperScript(int caret) | Test whether the text is supper script style. |
| IsSubScript(int caret) | Test whether the text is subscript style. |
| GetFont(int caret) | Get text font at caret. |
| GetFontSize(int caret) | Get font size at caret. |
| GetFontColor(int caret) | Get text color at caret. |
| GetCharSpace(int caret) | Get char space at caret. |
| GetWordSpace(int caret) | Get word space at caret. |
| GetLineSpace() | Get line space at caret. |
| GetHorzScale() | Get horizontal scale at caret. |
| SetCharSpace(int start_caret, int end_caret, float space, IPDF_ParaUndoIt…) | Set character space to selected texts. |
| SetWordSpace(int start_caret, int end_caret, float space, IPDF_ParaUndoIt…) | Set word space to selected texts. |
| SetLineSpace(int start_caret, int end_caret, float space, IPDF_ParaUndoIt…) | Set line space to selected texts. |
| SetCharHorzScale(int start_caret, int end_caret, float scale, IPDF_ParaUndoIt…) | Not support now. |
| GetAlign(int caret) | Get line alignment at caret. |
| SetAlign(int start_caret, int end_caret, int align, IPDF_ParaUndoItem…) | Set alignment to selected texts. |
| Offset(float dx, float dy, IPDF_ParaUndoItem* pUndoItem) | Move the paragrah. |
| Transform(IPDF_Matrix* matrix, IPDF_ParaUndoItem* pUndoItem) | Transform the paragrah. |
| ResizeWidth(int leftside_or_rightsize, float dx, IPDF_ParaUndoItem* pUnd…) | Resize the width of the paragrah. |
| GetCharUnicode(int caret) | Get unicode at caret. |
| GetCharsetAt(int caret) | Get char set at caret. |
| MoveLines(int start_caret, int end_caret, float xOffset, float yOffset) | Move lines. |
| ToXML(const wchar_t* temp_font_file) | Not support now. |
| GenerateForm() | Generate form. |
| GetSentenceRange(int caret, int& start_caret, int& end_caret) | Get sentence range. |
| GetInnerParaRange(int caret, int& start_caret, int& end_caret) | Get inner paragraph range. |
| ReplaceTexts(int start_caret, int end_caret, const wchar_t* new_text, IPD…) | Replace text in paragraph. |
| GetZOrder() | Not support now. |
| SetFiexdWidth(float fixed_width) | — |
| CountLines() | — |
| CountSubParagraphs() | — |
| GetSubPragraphPos(int iSub, PDSDK_FloatBox* box_para, int& start_caret, int& e…) | — |
GetBBox
public: virtual void GetBBox(PDSDK_FloatBox* box) = 0;
Get the bounding box of paragraph.
參數
box(out) — Receiv the bounding box in user space.
IsRotate
int IsRotate() = 0;
Test whether the paragraph is rotated.
傳回值:1 for rotated, 0 for normal.
IsVerticalWrittingMode
int IsVerticalWrittingMode() = 0;
Test whether the paragraph is vertical writting mode.
傳回值:1 for vertical writting, 0 for normal.
GetText
const wchar_t* GetText(int start_caret, int end_caret) = 0;
Get the text of specified range in paragraph.
參數
start_caret(in) — The start caret.end_caret(in) — The end caret.
傳回值:The unicodes in sepcified range.
GetText_UTF8
const char* GetText_UTF8(int start_caret, int end_caret) = 0;
Get the text of specified range in paragraph.
參數
start_caret(in) — The start caret.end_caret(in) — The end caret.
傳回值:The utf8 in sepcified range.
GetCurrentCaret
int GetCurrentCaret() = 0;
Get currernt caret after paragraph modify. When some text changed, such as rest text color,reset font, insert or delete text, the current caret should be changed, so must re-load it.
傳回值:The currrent caret.
GetCurCaretRange
void GetCurCaretRange(int* start_caret, int* end_caret) = 0;
Get currernt selection range after paragraph modify. When some text changed, such as rest text color,reset font, insert or delete text, the current caret should be changed, so must re-load it.
參數
start_caret(out) — Receiv the start caret of range.end_caret(out) — Receiv the end caret of range.
GetCaretAt
int GetCaretAt(const PDSDK_FloatPoint* point) = 0;
Get caret by point.
參數
point(in) — The point in user space.
傳回值:The caret amon the point, less then 0 means no caret catched.
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.
CountCarets
int CountCarets() = 0;
Count total number of carets in paragraph.
傳回值:The total number of carets.
IsHeaderCaret
int IsHeaderCaret(int caret) = 0;
Test whether is the first caret of the paragraph.
傳回值:1 for first caret, 0 for not.
IsTailCaret
int IsTailCaret(int caret) = 0;
Test whether is the tail caret of the paragraph.
傳回值:1 for tail caret, 0 for not.
GetLineHeaderCaret
int GetLineHeaderCaret(int caret) = 0;
Test whether is the first caret of a text line.
傳回值:1 for first caret of line, 0 for not.
GetLineTailCaret
int GetLineTailCaret(int caret) = 0;
Test whether is the tail caret of a text line.
傳回值:1 for tail caret of line, 0 for not.
CountSelBox
int CountSelBox(int start_caret, int end_caret) = 0;
Count the box number of selected text in paragraph.
參數
caret_start(in) — The start caret of selected text.caret_end(in) — The end caret of selected text.
傳回值:The number of box for selected text.
GetSelBox
int GetSelBox(int index, PDSDK_FloatBox* box) = 0;
Get the boxies of selected text in paragraph.
參數
index(in) — The zero-based box index, range is 0 to CountSelBox()-1.box(in) — Receive the box data.
傳回值:1 for success, 0 for failure.
InsertText
int InsertText(int caret, IPDF_Font* font, float font_size, unsigned int color, const wchar_t* text, int nBoldItalic, int nUnderlineStrikeout, int nScript, IPDF_ParaUndoItem* pUndoItem) = 0;
Insert text at the position specified by caret.
參數
caret(in) — The text caret to insert text.font(in) — Font for text.font_size(in) — Font size.color(in) — Text color.Use COLOR_ARGB_MAKE() to mark ARGB color.text(in) — The text.nBoldItalic(in) — A flag indicate the bold/italic.0 for normal, 1 for bold only, 2 for italic only, 3 for BoldItalic.nUnderlineStrikeout(in) — A flag indicate the underline/strikout, 0 for normal, 1 for underline, 2 for strikeout, 3 for both underline and italic.nScript(in) — Script type.@see Text script flagspUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
傳回值:1 for sucess, 0 for failure.
InsertText
int InsertText(int caret, IPDF_Font* font, float font_size, unsigned int color, const char* text_utf8, int nBoldItalic, int nUnderlineStrikeout, int nScript, IPDF_ParaUndoItem* pUndoItem) = 0;
UTF8 version for InsertText.
參數
caret(in) — The text caret to insert text.font(in) — Font for text.font_size(in) — Font size.color(in) — Text color.Use COLOR_ARGB_MAKE() to mark ARGB color.text(in) — The text.nBoldItalic(in) — A flag indicate the bold/italic.0 for normal, 1 for bold only, 2 for italic only, 3 for BoldItalic.nUnderlineStrikeout(in) — A flag indicate the underline/strikout, 0 for normal, 1 for underline, 2 for strikeout, 3 for both underline and italic.nScript(in) — Script type.@see Text script flagspUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
傳回值:1 for sucess, 0 for failure.
DeleteText
int DeleteText(int start_caret, int end_caret, IPDF_ParaUndoItem* pUndoItem) = 0;
Delete text in paragraph.
參數
start_caret(in) — The start caret of selected text.end_caret(in) — The end caret of selected text.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
傳回值:1 for sucess, 0 for failure.
BackSpaceAt
int BackSpaceAt(int caret, IPDF_ParaUndoItem* pUndoItem) = 0;
Do backspace event.
參數
caret(in) — The caret.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
傳回值:1 for sucess, 0 for failure.
InsertReturn
int InsertReturn(int caret, IPDF_ParaUndoItem* pUndoItem) = 0;
Insert return flag to start a new line.
參數
caret(in) — The caret indicate where the return flag will be inserted.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
傳回值:1 for sucess, 0 for failure.
SetStroke
int SetStroke(int start_caret, int end_caret, int isStroke, unsigned int stroke_color, IPDF_ParaUndoItem* pUndoItem) = 0;
Set stroke color to selected texts.
參數
start_caret(in) — The start caret of selected text.end_caret(in) — The end caret of selected text.isStroke(in) — A flag to decided whether the selected text to be stroke. 0 for not stroke, 1 for stroke.stroke_color(in) — Stroke color. Use COLOR_ARGB_MAKE() to mark ARGB color.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
傳回值:1 for sucess, 0 for failure.
SetTextColor
int SetTextColor(int start_caret, int end_caret, unsigned int color, IPDF_ParaUndoItem* pUndoItem) = 0;
Set text color (fill color) to selected texts.
參數
start_caret(in) — The start caret of selected text.end_caret(in) — The end caret of selected text.color(in) — Text color.Use COLOR_ARGB_MAKE() to mark ARGB color.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
傳回值:1 for sucess, 0 for failure.
SetFont
int SetFont(int start_caret, int end_caret, IPDF_Font* font, IPDF_ParaUndoItem* pUndoItem) = 0;
Set font to selected texts.
參數
start_caret(in) — The start caret of selected text.end_caret(in) — The end caret of selected text.font(in) — The pdf font.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
傳回值:1 for sucess, 0 for failure.
SetFontSize
int SetFontSize(int start_caret, int end_caret, float font_size, IPDF_ParaUndoItem* pUndoItem) = 0;
Set font size to selected texts.
參數
start_caret(in) — The start caret of selected text.end_caret(in) — The end caret of selected text.font_size(in) — The font size.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
傳回值:1 for sucess, 0 for failure.
SetItalic
int SetItalic(int start_caret, int end_caret, IPDF_ParaUndoItem* pUndoItem) = 0;
Set italic style to selected texts.
參數
start_caret(in) — The start caret of selected text.end_caret(in) — The end caret of selected text.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
傳回值:1 for sucess, 0 for failure.
SetBold
int SetBold(int start_caret, int end_caret, IPDF_ParaUndoItem* pUndoItem) = 0;
Set bold style to selected texts.
參數
start_caret(in) — The start caret of selected text.end_caret(in) — The end caret of selected text.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
傳回值:1 for sucess, 0 for failure.
SetUnderline
int SetUnderline(int start_caret, int end_caret, IPDF_ParaUndoItem* pUndoItem) = 0;
Set underline to selected texts.
參數
start_caret(in) — The start caret of selected text.end_caret(in) — The end caret of selected text.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
傳回值:1 for sucess, 0 for failure.
SetStrikeout
int SetStrikeout(int start_caret, int end_caret, IPDF_ParaUndoItem* pUndoItem) = 0;
Set strikout line to selected texts.
參數
start_caret(in) — The start caret of selected text.end_caret(in) — The end caret of selected text.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
傳回值:1 for sucess, 0 for failure.
SetScript
int SetScript(int start_caret, int end_caret, int nScript, IPDF_ParaUndoItem* pUndoItem) = 0;
Set script style to selected texts.
參數
start_caret(in) — The start caret of selected text.end_caret(in) — The end caret of selected text.nScript(in) — The script type. @see Text script flags.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
傳回值:1 for sucess, 0 for failure.
IsBold
int IsBold(int caret) = 0;
Test whether the text is bold.
參數
caret(in) — The caret to test.
傳回值:1 for bold, 0 for normal.
IsItalic
int IsItalic(int caret) = 0;
Test whether the text is italic.
參數
caret(in) — The caret to test.
傳回值:1 for italic, 0 for normal.
IsUnderline
int IsUnderline(int caret) = 0;
Test whether the text is underline style.
參數
caret(in) — The caret to test.
傳回值:1 for underline style, 0 for normal.
IsStrikeout
int IsStrikeout(int caret) = 0;
Test whether the text is strikout style.
參數
caret(in) — The caret to test.
傳回值:1 for strikout style, 0 for normal.
IsSupperScript
int IsSupperScript(int caret) = 0;
Test whether the text is supper script style.
參數
caret(in) — The caret to test.
傳回值:1 for supper script style, 0 for normal.
IsSubScript
int IsSubScript(int caret) = 0;
Test whether the text is subscript style.
參數
caret(in) — The caret to test.
傳回值:1 for subscript style, 0 for normal.
GetFont
IPDF_Font* GetFont(int caret) = 0;
Get text font at caret.
參數
caret(in) — The caret.
傳回值:The pdf font.
GetFontSize
float GetFontSize(int caret) = 0;
Get font size at caret.
參數
caret(in) — The caret.
傳回值:The font size.
GetFontColor
unsigned int GetFontColor(int caret) = 0;
Get text color at caret.
參數
caret(in) — The caret.
傳回值:The text color, ARGB format.
GetCharSpace
float GetCharSpace(int caret) = 0;
Get char space at caret.
參數
caret(in) — The caret.
傳回值:The character space.
GetWordSpace
float GetWordSpace(int caret) = 0;
Get word space at caret.
參數
caret(in) — The caret.
傳回值:The word space.
GetLineSpace
float GetLineSpace() = 0;
Get line space at caret.
參數
caret(in) — The caret.
傳回值:The line space.
GetHorzScale
float GetHorzScale() = 0;
Get horizontal scale at caret.
參數
caret(in) — The caret.
傳回值:The horizontal scale.
SetCharSpace
void SetCharSpace(int start_caret, int end_caret, float space, IPDF_ParaUndoItem* pUndoItem) = 0;
Set character space to selected texts.
參數
start_caret(in) — The start caret of selected text.end_caret(in) — The end caret of selected text.space(in) — The new character space.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
SetWordSpace
void SetWordSpace(int start_caret, int end_caret, float space, IPDF_ParaUndoItem* pUndoItem) = 0;
Set word space to selected texts.
參數
start_caret(in) — The start caret of selected text.end_caret(in) — The end caret of selected text.space(in) — The new word space.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
SetLineSpace
void SetLineSpace(int start_caret, int end_caret, float space, IPDF_ParaUndoItem* pUndoItem) = 0;
Set line space to selected texts.
參數
start_caret(in) — The start caret of selected text.end_caret(in) — The end caret of selected text.space(in) — The new line space.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
GetAlign
int GetAlign(int caret) = 0;
Get line alignment at caret.
參數
caret(in) — The caret.
傳回值:The line alignment.
见 Alignment of paragraph.
SetAlign
void SetAlign(int start_caret, int end_caret, int align, IPDF_ParaUndoItem* pUndoItem) = 0;
Set alignment to selected texts.
參數
start_caret(in) — The start caret of selected text.end_caret(in) — The end caret of selected text.align(in) — The new align. @see Alignment of paragraph.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
Offset
void Offset(float dx, float dy, IPDF_ParaUndoItem* pUndoItem) = 0;
Move the paragrah.
參數
dx(in) — The x-direction delta.dy(in) — The y-derection delta.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
Transform
void Transform(IPDF_Matrix* matrix, IPDF_ParaUndoItem* pUndoItem) = 0;
Transform the paragrah.
參數
matrix(in) — The transfrom matrix.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
ResizeWidth
void ResizeWidth(int leftside_or_rightsize, float dx, IPDF_ParaUndoItem* pUndoItem) = 0;
Resize the width of the paragrah.
參數
leftside_or_rightsize(in) — 0 for leftside moved, 1 for rightsize moved.dx(in) — The x-derection delta(oldside_x - newsize_x).pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
GetCharUnicode
unsigned short GetCharUnicode(int caret) = 0;
Get unicode at caret.
傳回值:Unicode of char.
GetCharsetAt
int GetCharsetAt(int caret) = 0;
Get char set at caret.
傳回值:Charset of char.
见 Font charsets, same as defined in Win32 font charsets
MoveLines
int MoveLines(int start_caret, int end_caret, float xOffset, float yOffset) = 0;
Move lines.
參數
start_caret(in) — The start caret of selected text.end_caret(in) — The end caret of selected text.xOffset(in) — The x-direction offset.yOffset(in) — The y-direction offset.
傳回值:1 for success, 0 for failure.
GetSentenceRange
void GetSentenceRange(int caret, int& start_caret, int& end_caret) = 0;
Get sentence range.
參數
caret(in) — The caret in a textline.start_caret(out) — Receiv start caret of sentence.end_caret(out) — Receiv end caret of sentence.
GetInnerParaRange
void GetInnerParaRange(int caret, int& start_caret, int& end_caret) = 0;
Get inner paragraph range.
參數
caret(in) — The caret in a textline.start_caret(out) — Receiv start caret of inner paragraph.end_caret(out) — Receiv end caret of inner paragraph.
ReplaceTexts
int ReplaceTexts(int start_caret, int end_caret, const wchar_t* new_text, IPDF_Font* pSubstFont, int& caret_anchor, float font_size, unsigned int font_color, int font_bold, int font_italic, IPDF_ParaUndoItem* pUndoItem) = 0;
Replace text in paragraph.
參數
start_caret(in) — The start caret of inner paragraph.end_caret(in) — The end caret of inner paragraph.new_text(in) — The new text use to replace.pSubstFont(in) — The font used to instea the old font when old font is embbedded.font_size(in) — The font size.-1 for invalide.font_color(in) — The font color.-1 for invalide.font_bold(in) — Bold style.-1 for invalide.1 for bold, 0 for normal.font_italic(in) — Italic style.-1 for invalide. 1 for italic, 0 for normal.new_text(in/out) — A caret anchor, it will be chage after replaced.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
class IPDF_Table
Not support now.
方法(7)
| 簽章 | 說明 |
|---|---|
| GetBBox(PDSDK_FloatRect* pBBox) | — |
| GetRowCount() | — |
| GetRowBBox(int iRow, PDSDK_FloatRect* pBBox) | — |
| GetCellCount(int iRow) | — |
| GetCellBBox(int iRow, int iCell, PDSDK_FloatRect* pBBox) | — |
| GetCellText(int iRow, int iCell) | — |
| GetCellTable(int iRow, int iCell) | — |
class IPDF_LogicalStructAnalyser
The text paragraph recognizer interface.
方法(9)
| 簽章 | 說明 |
|---|---|
| Release() | Release the Analyser. |
| DoAnalyse(IPDF_Page* page) | Start to recognize the paragraph for a page. |
| GetParagraphCount() | Get paragraph count. |
| GetParagraph(int index) | Get paragraph by index. |
| GetParagraph(const PDSDK_FloatPoint* point) | Get paragraph at point. |
| NewParagraphAt(const PDSDK_FloatPoint* point, float width, float height) | New paragraph at point. |
| DeleteParagraph(IPDF_Paragraph* para, IPDF_ParaUndoItem* pUndoItem) | Delete paragraph from the analyser. |
| GetTableCount() | Not support now. |
| GetTable(int index) | Not support now. |
DoAnalyse
int DoAnalyse(IPDF_Page* page) = 0;
Start to recognize the paragraph for a page.
參數
page(in) — The PDF page to analys.
傳回值:1 for success, 0 for failure.
GetParagraphCount
int GetParagraphCount() = 0;
Get paragraph count.
傳回值:The count of paragraphs.
GetParagraph
IPDF_Paragraph* GetParagraph(int index) = 0;
Get paragraph by index.
參數
index(in) — The zero-based paragraph index, range is 0 to GetParagraphCount()-1.
傳回值:The pdf paragrah at index.
GetParagraph
IPDF_Paragraph* GetParagraph(const PDSDK_FloatPoint* point) = 0;
Get paragraph at point.
參數
point(in) — The point in user space.
傳回值:The pdf paragrah at point.
NewParagraphAt
IPDF_Paragraph* NewParagraphAt(const PDSDK_FloatPoint* point, float width, float height) = 0;
New paragraph at point.
參數
point(in) — The point in user space.width(in) — The width of new paragraph.height(in) — The height of new paragraph.
傳回值:The newly paragrah.
DeleteParagraph
int DeleteParagraph(IPDF_Paragraph* para, IPDF_ParaUndoItem* pUndoItem) = 0;
Delete paragraph from the analyser.
參數
para(in) — The paragraph to be deleted.pUndoItem(in) — The undo item.Call PDSDK_CreateParaUndoItem() to creat the undo item.
傳回值:1 for success, 0 for failure.
class IPDF_ParaUndoItem
PDF paragraph undo item interface.
方法(3)
| 簽章 | 說明 |
|---|---|
| Release() | Release undo item. |
| Undo(IPDF_LogicalStructAnalyser* analyser) | Undo. |
| Redo(IPDF_LogicalStructAnalyser* analyser) | Redo. |