Foxit PDF SDK
fsdk.SetOCGStateAction Class Reference

Public Member Functions

def GetOCGState (index)
 Get the state of OCG.
More...
 
def GetOCGStateArray (index)
 Get the OCG dictionary array.
More...
 
def GetOCGStateCount ()
 Get the count of OCG states.
More...
 
def InsertOCGStates (document, index, state, ocg_dict_array)
 Insert the OCG states to action.
More...
 
def IsRadioButtonStatePreserved ()
 Get the radio-button preserved state.
More...
 
def RemoveOCGStates (index)
 Remove the OCG state.
More...
 
def ReplaceOCGStates (document, index, ocg_dict_array)
 Replace the OCG states array.
More...
 
def SetRadioButtonStatePreserved (is_preserved)
 Set the radio-button preserved state.
More...
 

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 fsdk.SetOCGStateAction is derived from Action and offers functions to get/set set-OCG-state action data.

See also
Action

Member Function Documentation

◆ GetOCGState()

def 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()

def 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()

def fsdk.SetOCGStateAction.GetOCGStateCount ( )

Get the count of OCG states.

Returns
The count of OCG states.

◆ InsertOCGStates()

def 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()

def 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()

def 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()

def 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()

def fsdk.SetOCGStateAction.SetRadioButtonStatePreserved (   is_preserved)

Set the radio-button preserved state.

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