THotPDF.FlattenLoadedPageRotation Method
Moves page rotation into a content transform and updates page boxes, annotations, destinations and structure geometry before clearing /Rotate
Declaration
function FlattenLoadedPageRotation(const PageRange: string;
out AInfo: THPDFRotationFlattenInfo): Integer;
The page is turned clockwise by its /Rotate value, precisely as a viewer displays it, so the flattened page looks identical at /Rotate 0. Page boxes the page owns, directly or down the page tree, rotate with it; boxes it lacks stay absent and keep their defaults
Annotation appearance streams turn with the page, and a widget's /MK /R rotation is reduced by the page turn, so annotations look the same afterwards whether displayed, flattened with FlattenLoadedAnnotations, or regenerated. Annotations carrying the NoRotate flag stay upright and keep their size, pinned at their upper-left corner as a viewer shows them on the rotated page
The result reports transformed pages and affected geometry categories