API referenceCore SDK

pdfGetBBox

Set/get one of the current page's 5 box kinds (Media/Crop/

C
BOOL32 __stdcall pdfSetBBox(PPDF IPDF, TPageBoundary Boundary, double LeftX, double LeftY, double RightX, double RightY);
BOOL32 __stdcall pdfGetBBox(PPDF IPDF, TPageBoundary Boundary, TPDFRect* BBox);
Delphi
function pdfSetBBox(const IPDF: PPDF; Boundary: TPageBoundary; LeftX, LeftY, RightX, RightY: Double): LongBool; stdcall;
function pdfGetBBox(const IPDF: PPDF; Boundary: TPageBoundary; var BBox: TPDFRect): LongBool; stdcall;

Purpose. Set/get one of the current page's 5 box kinds (Media/Crop/ Bleed/Trim/Art) — the fully-functional, Boundary-honoring member of the two-family split documented at the top of this chapter.

Description. Both route through BoundaryToBoxIdx(Boundary), a mapping table noted elsewhere in this manual (V04) as correcting an earlier ordinal mismatch between the ABI's TPageBoundary enum order (Art=0,Bleed=1,Crop=2,Trim=3,Media=4) and this engine's internal storage convention (0=Media,1=Crop,2=Bleed,3=Trim,4=Art) — so pdfSetBBox/ pdfGetBBox correctly target the box kind the caller actually requested, unlike the ordinal-confusable raw values.

Parameters.

ParameterDescription
IPDFDocument handle.
BoundaryWhich of the 5 box kinds to set/get.
LeftX,LeftY,RightX,RightY / BBoxThe box coordinates.

Return value. True on success; False if IPDF is invalid or no page is open.

See also. pdfSetPageBBox (the page-pointer family, which does not honor Boundary the same way).

C# (P/Invoke)

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

Getters

Exported names

pdfGetBBox

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.