BOOL32 __stdcall pdfSetPageBBox(IPGE PagePtr, TPageBoundary Boundary, TFltRect* BBox);
BOOL32 __stdcall pdfGetPageBBox(IPGE PagePtr, TPageBoundary Boundary, TFltRect* BBox);
function pdfSetPageBBox(PagePtr: IPGE; Boundary: TPageBoundary; var BBox: TFltRect): LongBool; stdcall;
function pdfGetPageBBox(PagePtr: IPGE; Boundary: TPageBoundary; var BBox: TFltRect): LongBool; stdcall;
Purpose. Set/get a page's box via an explicit page pointer (from pdfGetPageObject) rather than "whichever page is currently open."
Description. Verified: neither function genuinely supports per-box-kind targeting despite accepting Boundary. pdfGetPageBBox always returns [0, 0, Pg.Width, Pg.Height] — Boundary is never read at all, so Crop/Bleed/Trim/Art queries return exactly the same rectangle as a Media query. pdfSetPageBBox only applies a change when Boundary = pbMediaBox (setting Pg.Width/Pg.Height from the box dimensions) — for pbCropBox/pbBleedBox/pbTrimBox/ pbArtBox, the call still returns True but silently does nothing.
Parameters.
| Parameter | Description |
|---|---|
PagePtr | A page pointer from pdfGetPageObject. |
Boundary | Read only by pdfSetPageBBox, and only to gate on pbMediaBox — pdfGetPageBBox ignores it entirely. |
BBox | The box coordinates (get: always describes the overall page size; set: only applied for pbMediaBox). |
Return value. Both: True if PagePtr is non-null — this does not indicate the requested Boundary was actually honored.
See also. pdfSetBBox (the genuinely per-box-kind IPDF-based family).
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Getters
pdfGetPageBBox
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.