API referencePDF/A & Conformance

pdfAddDPartNode

Add a /DPart (Document Part, PDF 2.0's hierarchical

C
int32_t __stdcall pdfAddDPartNode(PPDF IPDF, int32_t Parent, int32_t FirstPage, int32_t LastPage, const char* DPM);
Delphi
function pdfAddDPartNode(const IPDF: PPDF; Parent, FirstPage, LastPage: Integer; const DPM: PAnsiChar): Integer; stdcall;

Purpose. Add a /DPart (Document Part, PDF 2.0's hierarchical document-partitioning mechanism — e.g. grouping chapters/sections with their own metadata) node covering a page range.

Description. DPM (DPart metadata) is a raw string narrowed via AnsiString, consistent with this SDK's general pattern of accepting either a structured-fields API or a raw-content-string API depending on the feature's maturity — /DPart here uses the latter.

Parameters.

ParameterDescription
IPDFDocument handle.
ParentParent /DPart node handle (0/negative = root).
FirstPage, LastPage1-based inclusive page range this node covers.
DPMRaw DPart metadata string.

Return value. The new node's handle; 0/negative on failure.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfAddDPartNode(IntPtr IPDF, int Parent, int FirstPage, int LastPage, [MarshalAs(UnmanagedType.LPStr)] string DPM);
Area
PDF/A & Conformance
Category

Content Creation

Exported names

pdfAddDPartNode

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.