THotPDF.GetLoadedPageHeight Method
Returns the media box height (in PDF points) of the specified page in the loaded PDF document, used for layout calculation or coordinate mapping
Declaration
function GetLoadedPageHeight(PageIndex: Integer): Single;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
PageIndex | Zero-based index of the target page |
Return value
Returns the media box height (in PDF points) of the page; returns 0 if the index is invalid
Usage notes
- The return value is based on the MediaBox and ignores CropBox cropping; read the CropBox separately if you need the visible area
- When the page is rotated (Rotate = 90 or 270) the visual height becomes the MediaBox width; factor in GetLoadedPageRotation
- When adding content to a loaded page, the height value is a key reference for calculating absolute coordinates in the PDF coordinate system (with the origin at the bottom-left corner)