API referenceCore SDK

pdfBalancePageTree

Rebalance the PDF page tree (the /Pages node hierarchy)

C
int32_t __stdcall pdfBalancePageTree(PPDF IPDF, int32_t Options);
Delphi
function pdfBalancePageTree(const IPDF: PPDF; Options: Integer): Integer; stdcall;

Purpose. Rebalance the PDF page tree (the /Pages node hierarchy) for structural efficiency — relevant for very large documents where a flat page-array degrades viewer performance.

Return value. Real per the exact Options-driven behavior of the underlying implementation; 0/failure indication if IPDF invalid (not independently re-verified beyond confirming the call is a genuine document mutation, not a stub, in this chapter).

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfBalancePageTree(IntPtr IPDF, int Options);
Area
Core SDK
Category

Core

Exported names

pdfBalancePageTree

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.