BOOL32 __stdcall pdfDeleteOCUINode(PPDF IPDF, IOCN Node);
IOCN __stdcall pdfGetOCUINode(PPDF IPDF, IOCN Node, PPDFOCUINode OutNode);
function pdfDeleteOCUINode(const IPDF: PPDF; Node: IOCN): LongBool; stdcall;
function pdfGetOCUINode(const IPDF: PPDF; Node: IOCN; OutNode: PPDFOCUINode): IOCN; stdcall;
Purpose. Walk and prune the layer-panel UI display tree (/OCProperties /D /Order, the hierarchical grouping/labeling shown in a PDF viewer's layers panel) — distinct from the OCG visibility state mechanisms (pdfSetOCGState/pdfSetOCGConfigState, Barcodes and Optional-Content (OCG) State) and from the core OCG creation/scoping APIs (Optional Content (OCG) Layers); this cluster manages the tree's presentational structure (labels, nesting, sibling order), not which layers are shown/hidden.
Description. pdfGetOCUINode fills OutNode (if non-null) with the node's label (both NameA/NameW, via SetOCNNameBuf), its associated OCG Layer handle, HasKids, and FirstChild/NextSibling node pointers for tree traversal — a linked-tree walk API, not an indexed enumeration. Node addresses tree nodes via a raw integer cast through an opaque IOCN pointer type (Integer(NativeInt(Node))) rather than a minted object-descriptor handle.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Node | An IOCN tree-node reference (root or a FirstChild/NextSibling value from a prior call). |
OutNode | *(Get only)* Output: label, associated OCG handle, and tree-traversal pointers. |
Return value. pdfDeleteOCUINode: True if Node resolves and was removed. pdfGetOCUINode: Node itself (non-nil) on success; nil if Node doesn't resolve.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Core
pdfDeleteOCUINode
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.