int32_t __stdcall pdfGetPageOrientation(IPGE PagePtr);
BOOL32 __stdcall pdfSetPageOrientation(PPDF IPDF, IPGE PagePtr, int32_t Value);
int32_t __stdcall pdfGetOrientation(PPDF IPDF);
BOOL32 __stdcall pdfSetOrientation(PPDF IPDF, int32_t Value);
BOOL32 __stdcall pdfSetOrientationEx(PPDF IPDF, int32_t Value);
function pdfGetPageOrientation(PagePtr: IPGE): Integer; stdcall;
function pdfSetPageOrientation(const IPDF: PPDF; PagePtr: IPGE; Value: Integer): LongBool; stdcall;
function pdfGetOrientation(const IPDF: PPDF): Integer; stdcall;
function pdfSetOrientation(const IPDF: PPDF; Value: Integer): LongBool; stdcall;
function pdfSetOrientationEx(const IPDF: PPDF; Value: Integer): LongBool; stdcall;
Purpose. Set/get page rotation (/Rotate) — via explicit page pointer (*PageOrientation) or the current page (Get/SetOrientation).
Description. pdfGetPageOrientation/pdfSetPageOrientation are real (Pg.Rotation) — pdfSetPageOrientation accepts both raw degree values (0/90/180/270) and a small 0-3 quadrant-index convention (1→90, 2→180, 3→270), with any other value falling back to 0. pdfSetOrientation and pdfSetOrientationEx are verified to be the literal identical implementation — both call SetPageOrient(Value) on the current page with no difference whatsoever; pdfGetOrientation reads it back (GetPageOrient).
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. *(GetPageOrientation doesn't take one at all.)* |
PagePtr | *(Page-pointer variants)* A page pointer from pdfGetPageObject. |
Value | Rotation: raw degrees or the 0..3 quadrant convention (page-pointer setter only; the current-page setters' exact accepted range is not independently re-verified beyond confirming both route to the same SetPageOrient). |
Return value. Getters: rotation in degrees; 0 if invalid. Setters: True on success.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Setters
pdfSetOrientation
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.