Set-OCG-state action is to sets the state of one or more optional content groups. (For more details, please refer to <PDF Reference 1.7> P667 "Set-OCG-State Actions") Class actions.SetOCGStateAction is derived from Action and offers functions to get/set set-OCG-state action data.
- See also
- Action
- Examples
- /Users/ec2-user/gitlab-runner/builds/E-xKdhDoq/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.
◆ constructor()
| SetOCGStateAction.constructor |
( |
action |
| ) |
|
Constructor, with parent class object.
- Parameters
-
| [in] | action | Parent class object. |
◆ GetOCGState()
| SetOCGStateAction.GetOCGState |
( |
index |
| ) |
|
Get the state of OCG.
- Parameters
-
| index | The index of OCG state. Valid range: from 0 to (count-1). count is returned by function SetOCGStateAction.GetOCGStateCount. |
- Returns
- The state of OCG.
◆ GetOCGStateArray()
| SetOCGStateAction.GetOCGStateArray |
( |
index |
| ) |
|
Get the OCG dictionary array.
- Parameters
-
| index | The index of OCG state. Valid range: from 0 to (count-1). count is returned by function SetOCGStateAction.GetOCGStateCount. |
- Returns
- The OCG dictionary array.
◆ GetOCGStateCount()
| SetOCGStateAction.GetOCGStateCount |
( |
| ) |
|
Get the count of OCG states.
- Returns
- The count of OCG states.
◆ InsertOCGStates()
| SetOCGStateAction.InsertOCGStates |
( |
document |
, |
|
|
index |
, |
|
|
state |
, |
|
|
ocg_dict_array |
|
|
) |
| |
Insert the OCG states to action.
- Parameters
-
| document | A valid PDF document object. |
| index | The index of OCG to insert after. Valid range: from 0 to (count-1). count is returned by function SetOCGStateAction.GetOCGStateCount. If this is below 0 or count is 0, the state is inserted to the first position. If this is larger than count, the state is added to the end. |
| state | The OCG state to insert. |
| ocg_dict_array | The OCG dictionary array to insert. |
- Returns
- The index of the inserted OCG states.
◆ IsRadioButtonStatePreserved()
| SetOCGStateAction.IsRadioButtonStatePreserved |
( |
| ) |
|
Get the radio-button preserved state.
If true, indicates that radio-button state relationships between optional content groups should be preserved when the states in the State array are applied. If false, radio-button state relationships, if any, are ignored. Default value: true.
- Returns
- The preserved state value.
◆ RemoveOCGStates()
| SetOCGStateAction.RemoveOCGStates |
( |
index |
| ) |
|
Remove the OCG state.
- Parameters
-
| index | The index of OCG to remove. Valid range: from 0 to (count-1). count is returned by function SetOCGStateAction.GetOCGStateCount. |
- Returns
- None.
◆ ReplaceOCGStates()
| SetOCGStateAction.ReplaceOCGStates |
( |
document |
, |
|
|
index |
, |
|
|
ocg_dict_array |
|
|
) |
| |
Replace the OCG states array.
- Parameters
-
| document | A valid PDF document object. |
| index | The index of OCG to replace. Valid range: from 0 to (count-1). count is returned by function SetOCGStateAction.GetOCGStateCount. |
| ocg_dict_array | The OCG dictionary array to insert. |
- Returns
- true means success, false means failure.
◆ SetRadioButtonStatePreserved()
| SetOCGStateAction.SetRadioButtonStatePreserved |
( |
is_preserved |
| ) |
|
Set the radio-button preserved state.
- Parameters
-
| is_preserved | The preserved state value. |
- Returns
- None.