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, exactly as a viewer displays it, so the flattened page looks the same with /Rotate 0. Page boxes the page has, directly or inherited from the page tree, are rotated with it; boxes it does not have stay absent and keep their defaults

Annotation appearance streams are turned with the page, and a widget's /MK /R rotation is reduced by the page turn, so annotations look the same afterwards whether they are displayed, flattened with FlattenLoadedAnnotations, or regenerated. Annotations with 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

Object Graph Editing and Page Assembly