Foxit PDF SDK
FSDK.SetOCGStateAction Class Reference

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...
 

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

Member Function Documentation

◆ constructor()

FSDK.SetOCGStateAction.constructor ( action  )

Constructor, with parent class object.

Parameters
[in]actionParent class object.

◆ GetOCGState()

FSDK.SetOCGStateAction.GetOCGState ( index  )

Get the state of OCG.

Parameters
[in]indexThe index of OCG state. Valid range: from 0 to (count-1). count is returned by function FSDK.SetOCGStateAction.GetOCGStateCount.
Returns
The state of OCG.

◆ GetOCGStateArray()

FSDK.SetOCGStateAction.GetOCGStateArray ( index  )

Get the OCG dictionary array.

Parameters
[in]indexThe index of OCG state. Valid range: from 0 to (count-1). count is returned by function FSDK.SetOCGStateAction.GetOCGStateCount.
Returns
The OCG dictionary array.

◆ GetOCGStateCount()

FSDK.SetOCGStateAction.GetOCGStateCount ( )

Get the count of OCG states.

Returns
The count of OCG states.

◆ InsertOCGStates()

FSDK.SetOCGStateAction.InsertOCGStates ( document  ,
index  ,
state  ,
ocg_dict_array   
)

Insert the OCG states to action.

Parameters
[in]documentA valid PDF document object.
[in]indexThe index of OCG want to insert. The OCG state will be inserted after the index. Valid range: from 0 to (count-1). count is returned by function FSDK.SetOCGStateAction.GetOCGStateCount.
If this is below 0 or count of OCG state in current action is 0, parameter state is to be inserted to the first position.
If this is larger than count of OCG state in current action, parameter state is to be added to the end.
[in]stateThe OCG state to insert.
[in]ocg_dict_arrayThe OCG dictionary array to insert.
Returns
The index of the inserted OCG states.

◆ IsRadioButtonStatePreserved()

FSDK.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()

FSDK.SetOCGStateAction.RemoveOCGStates ( index  )

Remove the OCG state.

Parameters
[in]indexThe index of OCG to remove. Valid range: from 0 to (count-1). count is returned by function FSDK.SetOCGStateAction.GetOCGStateCount.
Returns
None.

◆ ReplaceOCGStates()

FSDK.SetOCGStateAction.ReplaceOCGStates ( document  ,
index  ,
ocg_dict_array   
)

Replace the OCG states array.

Parameters
[in]documentA valid PDF document object.
[in]indexThe index of OCG want to replace. Valid range: from 0 to (count-1). count is returned by function FSDK.SetOCGStateAction.GetOCGStateCount.
[in]ocg_dict_arrayThe OCG dictionary array to insert.
Returns
true means is success, while false means not.

◆ SetRadioButtonStatePreserved()

FSDK.SetOCGStateAction.SetRadioButtonStatePreserved ( is_preserved  )

Set the radio-button preserved state.

Parameters
[in]is_preservedThe preserved state value.
Returns
None.