API referenceCore SDK

pdfHaveDPartRoot

Create/manage the /DPart document-partitioning tree — a

C
BOOL32 __stdcall pdfCreateDPartRoot(PPDF IPDF, PPAnsiChar NodeNameList, uint32_t NodeNamesCount, int32_t RecordLevel);
BOOL32 __stdcall pdfDeleteDPartNode(PPDF PPDF, int32_t Handle);
BOOL32 __stdcall pdfHaveDPartRoot(PPDF IPDF);
Delphi
function pdfCreateDPartRoot(const IPDF: PPDF; NodeNameList: PPAnsiChar; NodeNamesCount: Cardinal; RecordLevel: Integer): LongBool; stdcall;
function pdfDeleteDPartNode(const PPDF: PPDF; Handle: Integer): LongBool; stdcall;
function pdfHaveDPartRoot(const IPDF: PPDF): LongBool; stdcall;

Purpose. Create/manage the /DPart document-partitioning tree — a PDF 2.0 mechanism for grouping page ranges into named, independently- attributed sub-documents (e.g. chapters with distinct default viewer settings).

Description. pdfDeleteDPartNode's own document-handle parameter is literally named PPDF — identical to its type name PPDF — a real naming collision preserved from the original exported C header (visible directly in both the C and Pascal declarations above); this compiles and works correctly in both languages (the parameter name simply shadows the type name within the function's scope) but is a notable oddity worth flagging so it isn't mistaken for a documentation transcription error. pdfCreateDPartRoot builds the tree from a flat list of node names (NodeNameList/NodeNamesCount, a null entry becomes an empty-string node) plus a RecordLevel (how many levels of the name list correspond to actual /DPart nesting depth).

Parameters.

ParameterDescription
IPDF/PPDFDocument handle (see the naming-collision note for pdfDeleteDPartNode).
NodeNameList, NodeNamesCount*(Create only)* Flat array of node names.
RecordLevel*(Create only)* Nesting depth the name list represents.
Handle*(Delete only)* The /DPart node handle to remove.

Return value. pdfCreateDPartRoot/pdfDeleteDPartNode: True on success. pdfHaveDPartRoot: True if a /DPart tree has been created.

C# (P/Invoke)

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

Core

Exported names

pdfHaveDPartRoot

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.