API reference › Core SDK

pdfGetPageBBox

Set/get a page's box via an explicit page pointer (from

C
BOOL32 __stdcall pdfSetPageBBox(IPGE PagePtr, TPageBoundary Boundary, TFltRect* BBox);
BOOL32 __stdcall pdfGetPageBBox(IPGE PagePtr, TPageBoundary Boundary, TFltRect* BBox);
Delphi
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.

ParameterDescription
PagePtrA page pointer from pdfGetPageObject.
BoundaryRead only by pdfSetPageBBox, and only to gate on pbMediaBox — pdfGetPageBBox ignores it entirely.
BBoxThe 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)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Core SDK
Category

Getters

Exported names

pdfGetPageBBox

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.