pdfSetOCGConfigState
Set a single OCG's default visibility within a specific
BOOL32 __stdcall pdfSetOCGConfigState(PPDF IPDF, int32_t ConfigHandle, int32_t OCGHandle, BOOL32 Visible);
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.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
ConfigHandle | Handle of an existing alternate layer configuration. |
OCGHandle | Handle of an existing OCG. |
Visible | The 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)
[return: MarshalAs(UnmanagedType.Bool)]
Setters
pdfSetOCGConfigState
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.