RotatePageRange

Page manipulation

Description

Applies the same rotation to every page in a page range, so callers do not need a per-page SelectPage + RotatePage loop. The rotation follows RotatePage semantics: it is absolute, it must be a quarter-turn multiple (0, 90, 180 or 270), and the page co-ordinate system rotates with the page so content keeps its orientation relative to the page edges

The page selected before the call is restored afterwards, and a page that cannot be rotated is skipped without aborting the remaining pages

Syntax

Delphi

Function TPDFlib.RotatePageRange(Const PageRange: WideString; Angle: Integer): Integer;

Parameters

PageRangePages to rotate, in the usual "1,3,5-7" range syntax; an empty string selects every page
AngleThe absolute rotation to apply: 0, 90, 180 or 270 (the four canonical /Rotate values); any other value fails without touching the document

Return values

>= 0The number of pages that were actually rotated
0No page was rotated: no document is loaded, Angle is not one of 0, 90, 180 or 270, or the range selected no valid page

Remarks

Because the rotation is absolute, rotating a page that is already at 90 with Angle 90 leaves it at 90; it does not accumulate to 180

See also

RotatePage, PageRotation, SelectPage