Definitions for access to PDF text operation.
Definitions and functions in this module are included in fpdf_textpage_r.h.
Module: PDFTextPage
License Identifier: PDFTextPage/All
Available License Right: Reading.
More...
Classes | |
struct | FSPDF_TEXTPAGE |
Handle type to PDF text page. More... | |
struct | FSPDF_TEXTSELECTION |
Handle type to PDF text selection. More... | |
struct | FSPDF_TEXTSEARCH |
Handle type to PDF text search. More... | |
struct | FSPDF_TEXTLINK |
Handle type to PDF text link. More... | |
struct | FSPDF_TEXTPAGE_CHARINFO |
Structure for character's information definition. More... | |
Functions | |
FS_RESULT | FSPDF_TextPage_Load (FSCRT_PAGE pdfPage, FSPDF_TEXTPAGE *textPage) |
Prepare information of all characters in a page. More... | |
FS_RESULT | FSPDF_TextPage_LoadWithOption (FSCRT_PAGE pdfPage, FS_INT32 option, FSPDF_TEXTPAGE *textPage) |
Prepare information of all characters in a page, with option. More... | |
FS_RESULT | FSPDF_TextPage_Release (FSPDF_TEXTPAGE textPage) |
Release all resources allocated for a PDF text page handle. More... | |
FS_RESULT | FSPDF_TextPage_CountChars (FSPDF_TEXTPAGE textPage, FS_INT32 *count) |
Get count of characters in a page. More... | |
FS_RESULT | FSPDF_TextPage_GetChars (FSPDF_TEXTPAGE textPage, FS_INT32 start, FS_INT32 count, FSCRT_BSTR *chars) |
Get text content in a page, within a specific character range. More... | |
FS_RESULT | FSPDF_TextPage_GetUnicode (FSPDF_TEXTPAGE textPage, FS_INT32 index, FS_DWORD *unicode) |
Get the unicode representation of a character in a page. More... | |
FS_RESULT | FSPDF_TextPage_ExportToFile (FSPDF_TEXTPAGE textPage, FSCRT_FILE file) |
Export text content in a page to a specific file handle. More... | |
FS_RESULT | FSPDF_TextPage_GetCharInfo (FSPDF_TEXTPAGE textPage, FS_INT32 charIndex, FSPDF_TEXTPAGE_CHARINFO *info) |
Get character information of a specific character. More... | |
FS_RESULT | FSPDF_TextPage_GetCharIndexAtPos (FSPDF_TEXTPAGE textPage, FS_FLOAT x, FS_FLOAT y, FS_FLOAT tolerance, FS_INT32 *charIndex) |
Get the character index at or around a specific position on the page. More... | |
FS_RESULT | FSPDF_TextPage_SelectByRange (FSPDF_TEXTPAGE textPage, FS_INT32 start, FS_INT32 count, FSPDF_TEXTSELECTION *textSelection) |
Get a text selection handle by specific character range. More... | |
FS_RESULT | FSPDF_TextPage_SelectByRectangle (FSPDF_TEXTPAGE textPage, const FSCRT_RECTF *rect, FSPDF_TEXTSELECTION *textSelection) |
Get a text selection handle by specific rectangle. More... | |
FS_RESULT | FSPDF_TextSelection_Release (FSPDF_TEXTSELECTION textSelection) |
Release all resources allocated for a PDF text selection handle. More... | |
FS_RESULT | FSPDF_TextSelection_GetBBox (FSPDF_TEXTSELECTION textSelection, FSCRT_RECTF *bbox) |
Get bounding box(a rectangular area) of a PDF text selected area. More... | |
FS_RESULT | FSPDF_TextSelection_GetChars (FSPDF_TEXTSELECTION textSelection, FSCRT_BSTR *chars) |
Extract the whole text from a PDF text selected area. More... | |
FS_RESULT | FSPDF_TextSelection_CountPieces (FSPDF_TEXTSELECTION textSelection, FS_INT32 *count) |
Count the number of all rectangular areas of segments in a PDF text selected area. More... | |
FS_RESULT | FSPDF_TextSelection_GetPieceRect (FSPDF_TEXTSELECTION textSelection, FS_INT32 pieceIndex, FSCRT_RECTF *rect) |
Get rectangular area of a specific segment, based on the result of the fucntion FSPDF_TextSelection_CountPieces. More... | |
FS_RESULT | FSPDF_TextSelection_GetPieceRotation (FSPDF_TEXTSELECTION textSelection, FS_INT32 pieceIndex, FS_INT32 *rotation) |
Get rotation of the specific segment, based on the result returned by function FSPDF_TextSelection_CountPieces. More... | |
FS_RESULT | FSPDF_TextSelection_GetPieceCharRange (FSPDF_TEXTSELECTION textSelection, FS_INT32 pieceIndex, FS_INT32 *start, FS_INT32 *count) |
Get index of the start character and the count of characters of a specific segment. More... | |
FS_RESULT | FSPDF_TextSelection_GetLayerArray (FSPDF_TEXTSELECTION textSelection, FSPDF_LAYERNODE *layers, FSCRT_ARRAY *layerArray) |
Get the layer array associated with a PDF text selected area. More... | |
FS_RESULT | FSPDF_TextSelection_GetVisibleSelection (FSPDF_TEXTSELECTION textSelection, FSPDF_LAYERCONTEXT context, FSPDF_TEXTSELECTION *visibleSelection) |
Get a new PDF text selected area of visible content from a specific a PDF text selected area. More... | |
FS_RESULT | FSPDF_TextPage_StartSearch (FSPDF_TEXTPAGE textPage, const FSCRT_BSTR *searchPattern, FS_DWORD flags, FS_INT32 startIndex, FSPDF_TEXTSEARCH *textSearch) |
Start a PDF text search process. More... | |
FS_RESULT | FSPDF_TextSearch_Release (FSPDF_TEXTSEARCH textSearch) |
Release all resources allocated for a PDF text search handle. More... | |
FS_RESULT | FSPDF_TextSearch_FindNext (FSPDF_TEXTSEARCH textSearch, FS_BOOL *isMatch) |
Search in the direction from start to end of the page. More... | |
FS_RESULT | FSPDF_TextSearch_FindPrev (FSPDF_TEXTSEARCH textSearch, FS_BOOL *isMatch) |
Search in the direction from end to start of the page. More... | |
FS_RESULT | FSPDF_TextSearch_GetSelection (FSPDF_TEXTSEARCH textSearch, FSPDF_TEXTSELECTION *textSelection) |
Get a text selection handle from a text search when a match is found. More... | |
FS_RESULT | FSPDF_TextPage_ExtractLinks (FSPDF_TEXTPAGE textPage, FSPDF_TEXTLINK *textLink) |
Process a PDF page text object to get URL formatted texts (as hyperlinks). More... | |
FS_RESULT | FSPDF_TextLink_Release (FSPDF_TEXTLINK textLink) |
Release all resources allocated for a PDF text link handle. More... | |
FS_RESULT | FSPDF_TextLink_CountLinks (FSPDF_TEXTLINK textLink, FS_INT32 *linkCount) |
Get count of the URL formatted texts inside a page. More... | |
FS_RESULT | FSPDF_TextLink_GetLink (FSPDF_TEXTLINK textLink, FS_INT32 linkIndex, FSCRT_BSTR *linkURI) |
Get the linked URL associated with a specific hyperlink. More... | |
FS_RESULT | FSPDF_TextLink_GetSelection (FSPDF_TEXTLINK textLink, FS_INT32 linkIndex, FSPDF_TEXTSELECTION *textSelection) |
Get a PDF text selection handle from a specific hyperlink. More... | |
Macro Definitions for Character State | |
| |
#define | FSPDF_TEXTPAGE_CHARSTATE_NORMAL 1 |
Normal character. | |
#define | FSPDF_TEXTPAGE_CHARSTATE_GENERATED 2 |
Character is generated by Foxit, such as space character. | |
#define | FSPDF_TEXTPAGE_CHARSTATE_NONUNICODE 3 |
Character does not have its own unicode value . | |
Macro Definitions for PDF Text Page Parsing Flags | |
#define | FSPDF_TEXT_PARSEOPTION_STREAMORDER 0x0001 |
Parse the text content of PDF page by the stream order. | |
#define | FSPDF_TEXT_PARSEOPTION_OUTPUTHYPHEN 0x0002 |
Parse the text content of PDF page with outputting the hyphen on a line feed. | |
Definitions for access to PDF text operation.
Definitions and functions in this module are included in fpdf_textpage_r.h.
Module: PDFTextPage
License Identifier: PDFTextPage/All
Available License Right: Reading.
This module contains following features:
Get count of the URL formatted texts inside a page.
[in] | textLink | Handle to a FSPDF_TEXTLINK object returned by function FSPDF_TextPage_ExtractLinks. |
[out] | linkCount | Pointer to a FS_INT32 object that receives the count of links. If there is any error, it will be -1. |
FS_RESULT FSPDF_TextLink_GetLink | ( | FSPDF_TEXTLINK | textLink, |
FS_INT32 | linkIndex, | ||
FSCRT_BSTR * | linkURI | ||
) |
Get the linked URL associated with a specific hyperlink.
[in] | textLink | Handle to a FSPDF_TEXTLINK object returned by function FSPDF_TextPage_ExtractLinks. |
[in] | linkIndex | A zero-based index of the specific hyperlink. Range: from 0 to (linkcount - 1).linkcount is returned by function FSPDF_TextLink_CountLinks. |
[out] | linkURI | Pointer to a FSCRT_BSTR structure that receives the hyperlink URL. It is a UTF-8 string. |
FS_RESULT FSPDF_TextLink_GetSelection | ( | FSPDF_TEXTLINK | textLink, |
FS_INT32 | linkIndex, | ||
FSPDF_TEXTSELECTION * | textSelection | ||
) |
Get a PDF text selection handle from a specific hyperlink.
[in] | textLink | Handle to a FSPDF_TEXTLINK object returned by function FSPDF_TextPage_ExtractLinks. |
[in] | linkIndex | A zero-based index for the specific hyperlink. Range: from 0 to (linkcount - 1).linkcount is returned by function FSPDF_TextLink_CountLinks. |
[out] | textSelection | Pointer to a FSPDF_TEXTSELECTION handle to receive a new PDF text selection handle if successful. This handle can be used for PDF text selection related functions. Application should release this handle if not use by calling function FSPDF_TextSelection_Release. |
FS_RESULT FSPDF_TextLink_Release | ( | FSPDF_TEXTLINK | textLink | ) |
Release all resources allocated for a PDF text link handle.
[in] | textLink | Handle to a FSPDF_TEXTLINK object returned by function FSPDF_TextPage_ExtractLinks. |
Get count of characters in a page.
Generated characters, such as additional space and new line characters, are also counted.
Characters in a page are from a "stream". Inside the stream, each character has an index. This index is used in most PDF text page related functions and the first character in the page has an index value of zero.
[in] | textPage | Handle to a FSPDF_TEXTPAGE object returned by function FSPDF_TextPage_Load. |
[out] | count | Pointer to a FS_INT32 object that receives the count of characters in the page. If an error occurs, this will be set to -1. |
FS_RESULT FSPDF_TextPage_ExportToFile | ( | FSPDF_TEXTPAGE | textPage, |
FSCRT_FILE | file | ||
) |
Export text content in a page to a specific file handle.
Encode of the text is UTF-8.
[in] | textPage | Handle to a FSPDF_TEXTPAGE object returned by function FSPDF_TextPage_Load. |
[in] | file | Handle to a FSCRT_FILE object which can be a file object or memory buffer to export the text. This can be created by fucntion FSCRT_File_Create or FSCRT_File_CreateFromMemory. |
FS_RESULT FSPDF_TextPage_ExtractLinks | ( | FSPDF_TEXTPAGE | textPage, |
FSPDF_TEXTLINK * | textLink | ||
) |
Process a PDF page text object to get URL formatted texts (as hyperlinks).
This function must be called before any other hyperlink related functions can be used.
[in] | textPage | Handle to a FSPDF_TEXTPAGE object returned by function FSPDF_TextPage_Load. |
[out] | textLink | Pointer to a FSPDF_TEXTLINK handle to receive a new PDF text link handle if successful. Application should release this handle if not use by calling function FSPDF_TextLink_Release. If there is any error, it will be NULL. |
FS_RESULT FSPDF_TextPage_GetCharIndexAtPos | ( | FSPDF_TEXTPAGE | textPage, |
FS_FLOAT | x, | ||
FS_FLOAT | y, | ||
FS_FLOAT | tolerance, | ||
FS_INT32 * | charIndex | ||
) |
Get the character index at or around a specific position on the page.
[in] | textPage | Handle to a FSPDF_TEXTPAGE object returned by function FSPDF_TextPage_Load. |
[in] | x | Value of x position in PDF "user space". |
[in] | y | Value of y position in PDF "user space". |
[in] | tolerance | Tolerance value for character hit detection, in point units. This should not be a negative. |
[out] | charIndex | Pointer to a FS_INT32 object that receives the zero-based index of the character at, or nearby point (x,y). Specially, if there are several characters near by point (x, y), the smallest character index will be returned. If there is no character at or nearby the point, this parameter will be set to -1 as a result. |
FS_RESULT FSPDF_TextPage_GetCharInfo | ( | FSPDF_TEXTPAGE | textPage, |
FS_INT32 | charIndex, | ||
FSPDF_TEXTPAGE_CHARINFO * | info | ||
) |
Get character information of a specific character.
[in] | textPage | Handle to a FSPDF_TEXTPAGE object returned by function FSPDF_TextPage_Load. |
[in] | charIndex | A zero-based index of character. Range: from 0 to (charcount - 1).charcount is returned by function FSPDF_TextPage_CountChars. |
[out] | info | Pointer to a FSPDF_TEXTPAGE_CHARINFO structure that receives character information of the specific character. |
FS_RESULT FSPDF_TextPage_GetChars | ( | FSPDF_TEXTPAGE | textPage, |
FS_INT32 | start, | ||
FS_INT32 | count, | ||
FSCRT_BSTR * | chars | ||
) |
Get text content in a page, within a specific character range.
[in] | textPage | Handle to a FSPDF_TEXTPAGE object returned by function FSPDF_TextPage_Load. |
[in] | start | A zero-based index of character. It'll be the first character in text content. Range: from 0 to (charcount -1). charcount is returned by function FSPDF_TextPage_CountChars. |
[in] | count | Count of characters. -1 means to get the whole characters in the page. Especially, when parameter count is larger than (charcount - start), all the rest character (from start) will be counted. |
[out] | chars | Pointer to a FSCRT_BSTR structure that receives the text string. It is a UTF-8 string. |
Get the unicode representation of a character in a page.
[in] | textPage | Handle to a FSPDF_TEXTPAGE object returned by function FSPDF_TextPage_Load. |
[in] | index | A zero-based index of character. Range: from 0 to (charcount -1). charcount is returned by function FSPDF_TextPage_CountChars. |
[out] | unicode | Pointer to a FS_DWORD object to receive the character's unicode, in UTF-32 encoding. |
FS_RESULT FSPDF_TextPage_Load | ( | FSCRT_PAGE | pdfPage, |
FSPDF_TEXTPAGE * | textPage | ||
) |
Prepare information of all characters in a page.
[in] | pdfPage | Handle to a valid FSCRT_PAGE object. |
[out] | textPage | Pointer to a FSPDF_TEXTPAGE handle to receive a new PDF text page handle if successful. Application should release this handle if not use it any more by calling function FSPDF_TextPage_Release. |
FS_RESULT FSPDF_TextPage_LoadWithOption | ( | FSCRT_PAGE | pdfPage, |
FS_INT32 | option, | ||
FSPDF_TEXTPAGE * | textPage | ||
) |
Prepare information of all characters in a page, with option.
[in] | pdfPage | Handle to a valid FSCRT_PAGE object. |
[in] | option | An integer value that specifies the parsing option. Please refer to macro definitions FSPDF_TEXT_PARSEOPTION_XXX and this can be one or a combination of these macros. If set to 0, this function will be same with function FSPDF_TextPage_Load. |
[out] | textPage | Pointer to a FSPDF_TEXTPAGE handle to receive a new PDF text page handle if successful. Application should release this handle if not use it any more by calling function FSPDF_TextPage_Release. |
FS_RESULT FSPDF_TextPage_Release | ( | FSPDF_TEXTPAGE | textPage | ) |
Release all resources allocated for a PDF text page handle.
[in] | textPage | Handle to a FSPDF_TEXTPAGE object returned by function FSPDF_TextPage_Load. |
FS_RESULT FSPDF_TextPage_SelectByRange | ( | FSPDF_TEXTPAGE | textPage, |
FS_INT32 | start, | ||
FS_INT32 | count, | ||
FSPDF_TEXTSELECTION * | textSelection | ||
) |
Get a text selection handle by specific character range.
[in] | textPage | Handle to a FSPDF_TEXTPAGE object returned by function FSPDF_TextPage_Load. |
[in] | start | A zero-based index of the start character. Range: from 0 to (charcount - 1).charcount is returned by function FSPDF_TextPage_CountChars. |
[in] | count | Count of characters to be extracted. -1 means cover the whole characters in the page. |
[out] | textSelection | Pointer to a FSPDF_TEXTSELECTION handle to receive a new PDF text selection handle if successful. Application should release this handle if not use by calling function FSPDF_TextSelection_Release. |
FS_RESULT FSPDF_TextPage_SelectByRectangle | ( | FSPDF_TEXTPAGE | textPage, |
const FSCRT_RECTF * | rect, | ||
FSPDF_TEXTSELECTION * | textSelection | ||
) |
Get a text selection handle by specific rectangle.
[in] | textPage | Handle to a FSPDF_TEXTPAGE object returned or the parameter FSPDF_TextPage_Load. |
[in] | rect | Pointer to a FSCRT_RECTF structure that specifies rectangle range for selection. |
[out] | textSelection | Pointer to a FSPDF_TEXTSELECTION handle to receive a new PDF text selection handle if successful. Application should release this handle if not use by calling function FSPDF_TextSelection_Release. |
FS_RESULT FSPDF_TextPage_StartSearch | ( | FSPDF_TEXTPAGE | textPage, |
const FSCRT_BSTR * | searchPattern, | ||
FS_DWORD | flags, | ||
FS_INT32 | startIndex, | ||
FSPDF_TEXTSEARCH * | textSearch | ||
) |
Start a PDF text search process.
This function only starts a search process. Then function FSPDF_TextSearch_FindNext or FSPDF_TextSearch_FindPrev should be called to find the first matched pattern.
If there is no text in the page, this function will return FSCRT_ERRCODE_ERROR.
This function must be called before any other search related functions can be used for the page.
[in] | textPage | Handle to a FSPDF_TEXTPAGE object returned by function FSPDF_TextPage_Load. |
[in] | searchPattern | Pointer to a UTF-8 pattern string to be found. |
[in] | flags | Indicate the find options. 0 means no special finding options. And it can be one or combination of the following macro definitions: |
[in] | startIndex | A zero-based index specifying the character from which the search starts. -1 means from the end of the page. Range: from -1 to (charcount-1). charcount is returned by function FSPDF_TextPage_CountChars. |
[out] | textSearch | Pointer to a FSPDF_TEXTSEARCH handle to receive a new PDF text search handle if successful. Application should release this handle if not use by calling function FSPDF_TextSearch_Release. |
Search in the direction from start to end of the page.
[in] | textSearch | Handle to a FSPDF_TEXTSEARCH object returned by function FSPDF_TextPage_StartSearch. |
[out] | isMatch | Pointer to a FS_BOOL object that receives a boolean value which indicates whether a match is found or not. |
Search in the direction from end to start of the page.
[in] | textSearch | Handle to a FSPDF_TEXTSEARCH object returned by function FSPDF_TextPage_StartSearch. |
[out] | isMatch | Pointer to a FS_BOOL object that receives a boolean value which indicates whether a match is found or not. |
FS_RESULT FSPDF_TextSearch_GetSelection | ( | FSPDF_TEXTSEARCH | textSearch, |
FSPDF_TEXTSELECTION * | textSelection | ||
) |
Get a text selection handle from a text search when a match is found.
[in] | textSearch | Handle to a FSPDF_TEXTSEARCH object returned by function FSPDF_TextPage_StartSearch. |
[out] | textSelection | Pointer to a FSPDF_TEXTSELECTION handle to receive a new PDF text selection handle if successful. This handle can be used for PDF text selection related functions. Application should release this handle if not use by calling function FSPDF_TextSelection_Release. |
FS_RESULT FSPDF_TextSearch_Release | ( | FSPDF_TEXTSEARCH | textSearch | ) |
Release all resources allocated for a PDF text search handle.
[in] | textSearch | Handle to a FSPDF_TEXTSEARCH object returned by function FSPDF_TextPage_StartSearch. |
Count the number of all rectangular areas of segments in a PDF text selected area.
This function, along with fucntion FSPDF_TextSelection_GetPieceRect, can be used to detect the position of a text segment in a PDF page.
It is the area corresponding to the text segment that is to be highlighted.
It will automatically merge small character boxes into bigger ones if those characters are on the same line with the same font settings.
[in] | textSelection | Handle to a FSPDF_TEXTSELECTION object returned by function FSPDF_TextPage_SelectByRange, FSPDF_TextPage_SelectByRectangle, FSPDF_TextSearch_GetSelection, or FSPDF_TextLink_GetSelection. |
[out] | count | Pointer to a FS_INT32 object that receives the count of segments. |
FS_RESULT FSPDF_TextSelection_GetBBox | ( | FSPDF_TEXTSELECTION | textSelection, |
FSCRT_RECTF * | bbox | ||
) |
Get bounding box(a rectangular area) of a PDF text selected area.
Bounding box is the smallest rectangle to enclose the entire selected chars.
[in] | textSelection | Handle to a FSPDF_TEXTSELECTION object returned by function FSPDF_TextPage_SelectByRange, FSPDF_TextPage_SelectByRectangle, FSPDF_TextSearch_GetSelection, or FSPDF_TextLink_GetSelection. |
[out] | bbox | Pointer to a FSCRT_RECTF structure that receives the 4 boundaries in PDF page space units(left, bottom, right, top) of the bounding box. |
FS_RESULT FSPDF_TextSelection_GetChars | ( | FSPDF_TEXTSELECTION | textSelection, |
FSCRT_BSTR * | chars | ||
) |
Extract the whole text from a PDF text selected area.
[in] | textSelection | Handle to a FSPDF_TEXTSELECTION object returned by function FSPDF_TextPage_SelectByRange, FSPDF_TextPage_SelectByRectangle, FSPDF_TextSearch_GetSelection, or FSPDF_TextLink_GetSelection. |
[out] | chars | Pointer to a FSCRT_BSTR structure that receives the text. It is a UTF-8 string. |
FS_RESULT FSPDF_TextSelection_GetLayerArray | ( | FSPDF_TEXTSELECTION | textSelection, |
FSPDF_LAYERNODE * | layers, | ||
FSCRT_ARRAY * | layerArray | ||
) |
Get the layer array associated with a PDF text selected area.
Content in a PDF text selected area may be in several layers. This function is used to get a layer array which contains these layers.
[in] | textSelection | Handle to a FSPDF_TEXTSELECTION object returned by function FSPDF_TextPage_SelectByRange, FSPDF_TextPage_SelectByRectangle, FSPDF_TextSearch_GetSelection, or FSPDF_TextLink_GetSelection. |
[in] | layers | Pointer to a FSPDF_LAYERNODE structure which will be cleared. |
[in,out] | layerArray | Pointer to a FSCRT_ARRAY structure that receives the layer array. Please ensure to use function FSCRT_Array_Init (with dataType equals FSCRT_VT_OBJECT_LAYER) to initialize this, and application should call function FSCRT_Array_Clear to release this. |
FS_RESULT FSPDF_TextSelection_GetPieceCharRange | ( | FSPDF_TEXTSELECTION | textSelection, |
FS_INT32 | pieceIndex, | ||
FS_INT32 * | start, | ||
FS_INT32 * | count | ||
) |
Get index of the start character and the count of characters of a specific segment.
[in] | textSelection | Handle to a FSPDF_TEXTSELECTION object returned by function FSPDF_TextPage_SelectByRange, FSPDF_TextPage_SelectByRectangle, FSPDF_TextSearch_GetSelection, or FSPDF_TextLink_GetSelection. |
[in] | pieceIndex | A zero-based index of the segment, of which the character range is to be got. Range: from 0 to (segmentcount - 1).segmentcount is returned by function FSPDF_TextSelection_CountPieces. |
[out] | start | Pointer to a FS_INT32 object that receives the index of start character of the segment. -1 means error. |
[out] | count | Pointer to a FS_INT32 object that receives the count of characters in the segment. -1 means error. |
FS_RESULT FSPDF_TextSelection_GetPieceRect | ( | FSPDF_TEXTSELECTION | textSelection, |
FS_INT32 | pieceIndex, | ||
FSCRT_RECTF * | rect | ||
) |
Get rectangular area of a specific segment, based on the result of the fucntion FSPDF_TextSelection_CountPieces.
[in] | textSelection | Handle to a FSPDF_TEXTSELECTION object returned by function FSPDF_TextPage_SelectByRange, FSPDF_TextPage_SelectByRectangle, FSPDF_TextSearch_GetSelection, or FSPDF_TextLink_GetSelection. |
[in] | pieceIndex | A zero-based index of the segment. Range: from 0 to (segmentcount - 1).segmentcount is returned by function FSPDF_TextSelection_CountPieces. |
[out] | rect | Pointer to a FSCRT_RECTF structure that receives the 4 boundaries(left, top, right, bottom) of rectangle area. |
FS_RESULT FSPDF_TextSelection_GetPieceRotation | ( | FSPDF_TEXTSELECTION | textSelection, |
FS_INT32 | pieceIndex, | ||
FS_INT32 * | rotation | ||
) |
Get rotation of the specific segment, based on the result returned by function FSPDF_TextSelection_CountPieces.
Rotation value of text means how many degrees it costs to rotate the text in clockwise from horizontal direction to current direction.
[in] | textSelection | Handle to a FSPDF_TEXTSELECTION object returned by function FSPDF_TextPage_SelectByRange, FSPDF_TextPage_SelectByRectangle, FSPDF_TextSearch_GetSelection, or FSPDF_TextLink_GetSelection. |
[in] | pieceIndex | A zero-based index of the rotation segment. Range: from 0 to (segmentcount - 1).segmentcount is returned by function FSPDF_TextSelection_CountPieces. |
[out] | rotation | Pointer to a FS_INT32 object that receives the rotation for the text on the specific page rect. Range: 0 to 359 in clockwise. And -1 means failure. |
FS_RESULT FSPDF_TextSelection_GetVisibleSelection | ( | FSPDF_TEXTSELECTION | textSelection, |
FSPDF_LAYERCONTEXT | context, | ||
FSPDF_TEXTSELECTION * | visibleSelection | ||
) |
Get a new PDF text selected area of visible content from a specific a PDF text selected area.
Content in a PDF text selected area may be in several layers. Whether the content is visible depends on the visibility of the layer that the content belongs to. If user just wants to get the visible content, this function can be used.
[in] | textSelection | Handle to a FSPDF_TEXTSELECTION object returned by function FSPDF_TextPage_SelectByRange, FSPDF_TextPage_SelectByRectangle, FSPDF_TextSearch_GetSelection, or FSPDF_TextLink_GetSelection. |
[in] | context | Handle to a FSPDF_LAYERCONTEXT object which is PDF layer context. |
[out] | visibleSelection | Pointer to a FSPDF_TEXTSELECTION object that receives the new selected area. Application should call function FSPDF_TextSelection_Release to release this. |
FS_RESULT FSPDF_TextSelection_Release | ( | FSPDF_TEXTSELECTION | textSelection | ) |
Release all resources allocated for a PDF text selection handle.
[in] | textSelection | Handle to a FSPDF_TEXTSELECTION object to be released. It can be returned by function FSPDF_TextPage_SelectByRange, FSPDF_TextPage_SelectByRectangle, FSPDF_TextSearch_GetSelection, or FSPDF_TextLink_GetSelection. |