API reference › PDF/A & Conformance
pdfAddDPartNode
Add a /DPart (Document Part, PDF 2.0's hierarchical
int32_t __stdcall pdfAddDPartNode(PPDF IPDF, int32_t Parent, int32_t FirstPage, int32_t LastPage, const char* DPM);
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.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Parent | Parent /DPart node handle (0/negative = root). |
FirstPage, LastPage | 1-based inclusive page range this node covers. |
DPM | Raw DPart metadata string. |
Return value. The new node's handle; 0/negative on failure.
C# (P/Invoke)
public static extern int pdfAddDPartNode(IntPtr IPDF, int Parent, int FirstPage, int LastPage, [MarshalAs(UnmanagedType.LPStr)] string DPM);
Content Creation
pdfAddDPartNode
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.