GetTextInRegion
Viewer interaction, text
Description
Returns the text of the word-level blocks whose centres lie inside the given region of a page; coordinates and sizes are page user-space points in the same convention as the sibling page-space helpers
Blocks are returned in reading order, top to bottom then left to right; blocks on the same line are joined with spaces and blocks on different lines with line breaks
Syntax
Delphi
Function TPDFlibViewer.GetTextInRegion(APage: Integer; XPos, YPos, RWidth, RHeight: Double): WideString;Parameters
| APage | One-based page index |
|---|---|
| XPos, YPos | Top-left corner of the region in page points |
| RWidth, RHeight | Extents of the region in page points; both must be positive |
Return values
| WideString | The joined text of the hit blocks, empty for an invalid page, non-positive extents or when no block centre lies inside the region |
|---|
See also
TPDFlibViewer, GetSelectedRegion, CopySelectedText, AddHighlightRegion