PageRectToClientRect

Viewer interaction

Description

Maps a rectangle given in top-down page user space to client pixels, through the zoom, view rotation and scroll positions currently in effect

The returned rectangle is the axis-aligned hull of the rotated corner pair, and the call works without a window handle so it can be used headlessly

Syntax

Delphi

Function TPDFlibViewer.PageRectToClientRect(APage: Integer; XPt, YPt, WPt, HPt: Double; Out R: TRect): Boolean;

Parameters

APage1-based page whose rectangle is mapped
XPtLeft edge of the rectangle in page user-space points
YPtTop edge of the rectangle in page user-space points
WPtWidth of the rectangle in page user-space points
HPtHeight of the rectangle in page user-space points
RReceives the mapped client-pixel rectangle

Return values

FalseThe page is out of range or not laid out in the current display mode, and R is an empty rectangle
TrueR receives the mapped client rectangle

See also

RegionAtClientPoint, SelectRegion, TPDFlibViewer