THotPDF.GetLoadedPageRotation Method
Returns the rotation angle (in degrees) of the specified page in the loaded PDF document, used to determine the page orientation before rendering or export
Declaration
function GetLoadedPageRotation(PageIndex: Integer): Integer;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
PageIndex | Zero-based index of the target page |
Return value
Returns the page rotation angle, valid values are 0, 90, 180, 270 (clockwise degrees); returns 0 if the page is not rotated or the index is invalid
Usage notes
- The page rotation value follows the PDF specification: 0 means the normal orientation, 90 means rotated 90 degrees clockwise, and so on
- The rotation value can be inherited from a parent node in the page tree; this method returns the final effective rotation value after resolving inheritance
- When adding annotations or form fields to a rotated page, coordinates must be transformed accordingly to align with the visual coordinate system