API referenceCore SDK

pdfLoadLayerConfig

Apply an alternate configuration's layer visibility to the

CategoryOptional content

Purpose — Apply an alternate configuration's layer visibility to the document's *current* (working) OCG visibility state.

DescriptionIndex=0 restores every OCG to the visibility it had when created via pdfCreateOCG (the default /D config). Index >= 1 applies a named config created via pdfCreateOCLayerConfignote the off-by-one: Index here is a config-*index* (Index-1 is the 0-based slot into the config array), whereas pdfCreateOCLayerConfig returns a 1-based config-*handle*. In practice they are numerically the same value for a config created immediately after CreateOCLayerConfig returns N: pass N as Index to load it. For that config, every OCG first takes the config's /BaseState, then explicit per-OCG ON overrides are applied, then explicit OFF overrides (pdfSetOCGConfigState) — OFF wins if an OCG is marked in both arrays for the same config (should not normally occur, since SetOCGConfigStateH always writes both arrays consistently as mutually exclusive).

Declarations

C
BOOL32 __stdcall pdfLoadLayerConfig(PPDF IPDF, int32_t Index);
Delphi
function pdfLoadLayerConfig(const IPDF: PPDF; Index: Integer): LongBool; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
IndexInteger0 = default config; 1..configCount = a named config.

Return valueTRUE on success; FALSE if there are no OCGs, or Index is out of range for a named config.

See alsopdfCreateOCLayerConfig, pdfGetLayerConfig

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Core SDK
Category

Core

Exported names

pdfLoadLayerConfig

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.