API referenceCore SDK

pdfGetOCUINode

Walk and prune the layer-panel UI display tree

C
BOOL32 __stdcall pdfDeleteOCUINode(PPDF IPDF, IOCN Node);
IOCN __stdcall pdfGetOCUINode(PPDF IPDF, IOCN Node, PPDFOCUINode OutNode);
Delphi
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.

ParameterDescription
IPDFDocument handle.
NodeAn 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)

wrappers/dotnet/LumasPdf.cs
public static extern IntPtr pdfGetOCUINode(IntPtr IPDF, IntPtr Node, IntPtr OutNode);
Area
Core SDK
Category

Getters

Exported names

pdfGetOCUINode

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.