Foxit PDF SDK for HarmonyOS  3.0
SetOCGStateAction Class Reference
Inheritance diagram for SetOCGStateAction:
NativeObjectWrapper

Public Member Functions

 constructor (action)
 Constructor, with parent class object. More...
 
 GetOCGState (index)
 Get the state of OCG. More...
 
 GetOCGStateArray (index)
 Get the OCG dictionary array. More...
 
 GetOCGStateCount ()
 Get the count of OCG states. More...
 
 InsertOCGStates (document, index, state, ocg_dict_array)
 Insert the OCG states to action. More...
 
 IsRadioButtonStatePreserved ()
 Get the radio-button preserved state. More...
 
 RemoveOCGStates (index)
 Remove the OCG state. More...
 
 ReplaceOCGStates (document, index, ocg_dict_array)
 Replace the OCG states array. More...
 
 SetRadioButtonStatePreserved (is_preserved)
 Set the radio-button preserved state. More...
 
- Public Member Functions inherited from NativeObjectWrapper
 constructor (r)
 
 GetPointerAsNumber ()
 

Static Public Attributes

static e_OCGStateOff
 Sets the state of subsequent groups to OFF.
 
static e_OCGStateOn
 Sets the state of subsequent groups to ON.
 
static e_OCGStateToggle
 Reverses the state of subsequent groups.
 

Detailed Description

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.

Member Function Documentation

◆ constructor()

SetOCGStateAction.constructor ( action  )

Constructor, with parent class object.

Parameters
[in]actionParent class object.

◆ GetOCGState()

SetOCGStateAction.GetOCGState ( index  )

Get the state of OCG.

Parameters
indexThe 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
indexThe 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
documentA valid PDF document object.
indexThe 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.
stateThe OCG state to insert.
ocg_dict_arrayThe 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
indexThe 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
documentA valid PDF document object.
indexThe index of OCG to replace. Valid range: from 0 to (count-1). count is returned by function SetOCGStateAction.GetOCGStateCount.
ocg_dict_arrayThe 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_preservedThe preserved state value.
Returns
None.