SetFormFieldOCGStateAction

Form fields, actions, optional content

Description

Creates a typed SetOCGState action and binds it to a named form-field event

Syntax

Function TPDFlib.SetFormFieldOCGStateAction(Index: Integer; Const EventName: WideString; Const States: Array Of TPDFlibActionOCGStateInfo; PreserveRB: Integer): Integer;

Parameters

IndexOne-based form-field index
EventNameReadable event name such as MouseUp, Enter, Focus or Calculate
StatesOrdered optional-content group state changes
PreserveRB-1 omits the key and uses the standard true default, 0 ignores radio-button relationships and 1 preserves them

Return values

Returns 1 on success or 0 when the field, event, group handle, preference or PDF/A-1 mode is invalid

Remarks

The method automatically raises the output version to PDF 1.5 and does not partially bind an action when validation fails

See also

SetActionOCGStates, AddActionNextSetOCGState, TPDFlibActionOCGStateInfo