API referenceGraphics

pdfSetOCGConfigState

Set a single OCG's default visibility within a specific

C
BOOL32 __stdcall pdfSetOCGConfigState(PPDF IPDF, int32_t ConfigHandle, int32_t OCGHandle, BOOL32 Visible);
Delphi
function pdfSetOCGConfigState(const IPDF: PPDF; ConfigHandle, OCGHandle: Integer; Visible: LongBool): LongBool; stdcall;

Purpose. Set a single OCG's default visibility within a specific named layer configuration (a pdfCreateOCLayerConfig/pdfLoadLayerConfig alternate /D-array config, Optional Content (OCG) Layers) — as opposed to the document's base default configuration.

Description. Real and validated: both ConfigHandle and OCGHandle must resolve to existing entries (1-based, bounds-checked against FCfgCount/FOCGCount); on success, records Visible (and its logical inverse) into that specific config's per-OCG ON/OFF membership arrays (FCfgOn/FCfgOff), lazily growing them to the current OCG count if needed. Distinct from pdfSetOCGState below, which affects the document-wide base configuration, not an alternate named one.

Parameters.

ParameterDescription
IPDFDocument handle.
ConfigHandleHandle of an existing alternate layer configuration.
OCGHandleHandle of an existing OCG.
VisibleThe default visibility to record for this OCG within that specific configuration.

Return value. True if both handles resolved; False otherwise.

See also. pdfSetOCGState, pdfCreateOCLayerConfig.

C# (P/Invoke)

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

Setters

Exported names

pdfSetOCGConfigState

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.