API reference › PDF/A & Conformance
pdfAddOCGRadioGroup
Declare a set of optional-content groups as a mutually
BOOL32 __stdcall pdfAddOCGRadioGroup(PPDF IPDF, int32_t ConfigHandle, int32_t* OCGHandles, uint32_t Count);
function pdfAddOCGRadioGroup(const IPDF: PPDF; ConfigHandle: Integer; const OCGHandles: PInteger; Count: Cardinal): LongBool; stdcall;
Purpose. Declare a set of optional-content groups as a mutually exclusive "radio group" (/RBGroups) — turning one on in a real viewer automatically turns the others in the same group off.
Description. Marshals the OCGHandles array, silently filtering out any handle that doesn't resolve to a real OCG (1..FOCGCount) — a partially-invalid array still succeeds with just the valid members included, rather than failing outright; fails only if zero members end up valid. ConfigHandle = 0 registers the group as a document-wide default radio group (FDRBGroups, emitted under the catalog's default /D config); any other, resolvable ConfigHandle registers it as scoped to that specific alternate /OCProperties/Configs entry instead (FCfgRB[ConfigIndex]) — two genuinely different storage arrays depending on this one parameter's value.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
ConfigHandle | 0 = document-wide default config's radio group; a resolvable alternate-config handle = scoped to that config only. |
OCGHandles | Array of OCG handles forming the mutually-exclusive set; invalid entries are silently dropped, not rejected. |
Count | Element count for OCGHandles. |
Return value. True if at least one valid OCG handle was included (and, for a non-zero ConfigHandle, that config itself resolves); False otherwise.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Content Creation
pdfAddOCGRadioGroup
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.