API referencePDF/A & Conformance

pdfAddOCGRadioGroup

Declare a set of optional-content groups as a mutually

C
BOOL32 __stdcall pdfAddOCGRadioGroup(PPDF IPDF, int32_t ConfigHandle, int32_t* OCGHandles, uint32_t Count);
Delphi
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.

ParameterDescription
IPDFDocument handle.
ConfigHandle0 = document-wide default config's radio group; a resolvable alternate-config handle = scoped to that config only.
OCGHandlesArray of OCG handles forming the mutually-exclusive set; invalid entries are silently dropped, not rejected.
CountElement 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)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
PDF/A & Conformance
Category

Content Creation

Exported names

pdfAddOCGRadioGroup

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.