THotPDF.GetLoadedPageWidth Method
Returns the media box width (in PDF points) of the specified page in the loaded PDF document, used for layout calculation or coordinate mapping
Declaration
function GetLoadedPageWidth(PageIndex: Integer): Single;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
PageIndex | Zero-based index of the target page |
Return value
Returns the width value of the page's MediaBox (unit: PDF points, 1 point = 1/72 inch); 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 the visual width and height swap with the MediaBox; factor in GetLoadedPageRotation
- 1 PDF point = 1/72 inch; to convert to millimetres, multiply by 25.4/72