function NormalizePageViewRect(X1, Y1, X2, Y2, PageWidth, PageHeight: Double; out Left, Top, Right, Bottom: Double): Boolean;
| X1, Y1, X2, Y2 | Double |
| PageWidth, PageHeight | Double |
| Left, Top, Right, Bottom | Double |
BooleanPage space counts Y upwards while device space counts it down, so two mapped corners arrive in either order; the smaller values become Left and Top
The rectangle is clamped to the page bounds, so an oversized viewport reports the page itself rather than the viewport
Returns False when the page has no size or the clamped rectangle is empty, which is how a page scrolled entirely out of view is reported
Split out of the FFI_GetPageViewRect form-fill callback so the geometry is testable without a cdecl callback round trip