pdfDeleteOCGFromDisplayTree
Remove a layer from the viewer's layer panel (/OCProperties
| Category | Optional content |
|---|---|
| Availability | Partial — Recursive parameter unused — see Remarks |
Purpose — Remove a layer from the viewer's layer panel (/OCProperties /D /Order) without deleting the layer object itself.
Description — Clears the OCG's in-order flag; the OCG dictionary and its content-stream references remain intact (existing /OC /OCn BDC scoping still works and the layer can still be toggled programmatically) — only its entry in the display tree is suppressed, so end users no longer see it listed in the viewer's layers panel.
Declarations
BOOL32 __stdcall pdfDeleteOCGFromDisplayTree(PPDF IPDF, uint32_t OCGHandle, BOOL32 Recursive);
function pdfDeleteOCGFromDisplayTree(const IPDF: PPDF; OCGHandle: Cardinal; Recursive: LongBool): LongBool; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
OCGHandle | Cardinal | OCG handle to remove from the display tree. |
Recursive | BOOL32 | Accepted for ABI compatibility; not applied — see Remarks. |
Return value — TRUE on success; FALSE if OCGHandle is out of range.
Remarks — compatibility parameters. Recursive is intended (per the reference ABI) to also remove nested display-tree children under this layer via pdfAddLayerToDisplTree parent/child relationships, but this build only clears the flag on the given handle — nested UI-tree nodes added under it are unaffected regardless of Recursive's value.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Core
pdfDeleteOCGFromDisplayTree
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.