SelectRegion

Viewer interaction

Description

Creates the same retained selection a vmSelect drag produces, given a rectangle in page user-space points, and extracts its text into SelectedText

Negative widths and heights are normalised, a zero extent is rejected, and OnMarqueeSelect may veto persistence while SelectedText still reports the extracted text

Syntax

Delphi

Function TPDFlibViewer.SelectRegion(APage: Integer; XPos, YPos, RWidth, RHeight: Double): Integer;

Parameters

APage1-based page of the region
XPosLeft edge of the region in page user-space points
YPosTop edge of the region in page user-space points
RWidthWidth of the region in page user-space points, negative values are normalised
RHeightHeight of the region in page user-space points, negative values are normalised

Return values

0No document is open, the page is out of range, the extent is zero, or the event vetoed persistence
> 0The selection was retained and the value is the new total number of selections

See also

OnMarqueeSelect, SelectedText, SelectedRegionCount, SelectionColor, TPDFlibViewer