Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
com.foxit.sdk.pdf.actions.SetOCGStateAction Class Reference
Inheritance diagram for com.foxit.sdk.pdf.actions.SetOCGStateAction:

## Public Member Functions
| SetOCGStateAction (Action action)
| Constructor, with parent class object. More...
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
int | getOCGState (int index) throws com.foxit.sdk.PDFException
| Get the state of OCG. More...
PDFDictionaryArray | getOCGStateArray (int index) throws com.foxit.sdk.PDFException
| Get the OCG dictionary array. More...
int | getOCGStateCount () throws com.foxit.sdk.PDFException
| Get the count of OCG states. More...
int | insertOCGStates (PDFDoc document, int index, int state, PDFDictionaryArray ocg_dict_array) throws com.foxit.sdk.PDFException
| Insert the OCG states to action. More...
boolean | isRadioButtonStatePreserved () throws com.foxit.sdk.PDFException
| Get the radio-button preserved state. More...
void | removeOCGStates (int index) throws com.foxit.sdk.PDFException
| Remove the OCG state. More...
boolean | replaceOCGStates (PDFDoc document, int index, PDFDictionaryArray ocg_dict_array) throws com.foxit.sdk.PDFException
| Replace the OCG states array. More...
void | setRadioButtonStatePreserved (boolean is_preserved) throws com.foxit.sdk.PDFException
| Set the radio-button preserved state. More...
Public Member Functions inherited from com.foxit.sdk.pdf.actions.Action
| Action (Action action)
| Constructor, with another action object. More...
| Action (PDFDoc document, PDFDictionary action_dict)
| Constructor, with parameters. More...
PDFDictionary | getDict () throws com.foxit.sdk.PDFException
| Get PDF dictionary of current object. More...
PDFDoc | getDocument () throws com.foxit.sdk.PDFException
| Get the PDF document, to which current action belongs. More...
Action | getSubAction (int index) throws com.foxit.sdk.PDFException
| Get a sub-action by index. More...
int | getSubActionCount () throws com.foxit.sdk.PDFException
| Get the count of sub-actions. More...
int | getType () throws com.foxit.sdk.PDFException
| Get action type. More...
void | insertSubAction (int index, Action sub_action) throws com.foxit.sdk.PDFException
| Insert a new sub-action to the location specified by index. More...
boolean | isEmpty ()
| Check whether current object is empty or not. More...
void | removeAllSubActions () throws com.foxit.sdk.PDFException
| Remove all the sub-actions. More...
void | removeSubAction (int index) throws com.foxit.sdk.PDFException
| Remove a sub-action, specified by index. More...
void | setSubAction (int index, Action sub_action) throws com.foxit.sdk.PDFException
| Set a sub-action by index. More...

## Static Public Attributes
static final int | e_OCGStateOff = 1
| Sets the state of subsequent groups to OFF.
static final int | e_OCGStateOn = 0
| Sets the state of subsequent groups to ON.
static final int | e_OCGStateToggle = 2
| Reverses the state of subsequent groups.
Static Public Attributes inherited from com.foxit.sdk.pdf.actions.Action
static final int | e_NewWindowFlagFalse = 0
| "NewWindow" flag is false.
static final int | e_NewWindowFlagNone = 2
| No "NewWindow" flag.
static final int | e_NewWindowFlagTrue = 1
| "NewWindow" flag is true.
static final int | e_TypeGoto = 1
| Action type: go-to action.
static final int | e_TypeGoTo3DView = 18
| Action type: go-to-3D-view action.
static final int | e_TypeGoToE = 3
| Action type: embedded go-to action.
static final int | e_TypeGoToR = 2
| Action type: remote go-to action.
static final int | e_TypeHide = 9
| Action type: hide action.
static final int | e_TypeImportData = 13
| Action type: import-data action.
static final int | e_TypeJavaScript = 14
| Action type: JavaScript action.
static final int | e_TypeLaunch = 4
| Action type: launch action.
static final int | e_TypeMovie = 8
| Action type: movie action.
static final int | e_TypeNamed = 10
| Action type: named action.
static final int | e_TypeRendition = 16
| Action type: rendition action.
static final int | e_TypeResetForm = 12
| Action type: reset-form action.
static final int | e_TypeSetOCGState = 15
| Action type: set-OCG-state action.
static final int | e_TypeSound = 7
| Action type: sound action.
static final int | e_TypeSubmitForm = 11
| Action type: submit-form action.
static final int | e_TypeThread = 5
| Action type: thread action.
static final int | e_TypeTrans = 17
| Action type: transition action.
static final int | e_TypeUnknown = 0
| Action type: unknown action.
static final int | e_TypeURI = 6
| Action type: uniform resource identifier (URI) action.

## Additional Inherited Members
Static Public Member Functions inherited from com.foxit.sdk.pdf.actions.Action
static Action | create (PDFDoc document, int action_type) throws com.foxit.sdk.PDFException
| Create a new action, for specified action type. 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 com.foxit.sdk.pdf.actions.SetOCGStateAction is derived from Action and offers functions to get/set set-OCG-state action data.

See also
  Action

## Constructor & Destructor Documentation

## ◆ SetOCGStateAction()

com.foxit.sdk.pdf.actions.SetOCGStateAction.SetOCGStateAction | ( | Action | action | ) |

Constructor, with parent class object.

Parameters

  [in] | action | Parent class object.

## Member Function Documentation

## ◆ delete()

synchronized void com.foxit.sdk.pdf.actions.SetOCGStateAction.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

Note
  Once this function is called, current object cannot be used anymore.

Reimplemented from com.foxit.sdk.pdf.actions.Action.

## ◆ getOCGState()

int com.foxit.sdk.pdf.actions.SetOCGStateAction.getOCGState | ( | int | index | ) | throws com.foxit.sdk.PDFException

Get the state of OCG.

Parameters

  [in] | 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()

PDFDictionaryArray com.foxit.sdk.pdf.actions.SetOCGStateAction.getOCGStateArray | ( | int | index | ) | throws com.foxit.sdk.PDFException

Get the OCG dictionary array.

Parameters

  [in] | 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()

int com.foxit.sdk.pdf.actions.SetOCGStateAction.getOCGStateCount | ( |  | ) | throws com.foxit.sdk.PDFException

Get the count of OCG states.

Returns
  The count of OCG states.

## ◆ insertOCGStates()

int com.foxit.sdk.pdf.actions.SetOCGStateAction.insertOCGStates | ( | PDFDoc | document,
|  | int | index,
|  | int | state,
|  | PDFDictionaryArray | ocg_dict_array
| ) |  | throws com.foxit.sdk.PDFException

Insert the OCG states to action.

Parameters

  [in] | document | A valid PDF document object.
  [in] | index | The 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 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] | state | The OCG state to insert.
  [in] | ocg_dict_array | The OCG dictionary array to insert.

Returns
  The index of the inserted OCG states.

## ◆ isRadioButtonStatePreserved()

boolean com.foxit.sdk.pdf.actions.SetOCGStateAction.isRadioButtonStatePreserved | ( |  | ) | throws com.foxit.sdk.PDFException

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

void com.foxit.sdk.pdf.actions.SetOCGStateAction.removeOCGStates | ( | int | index | ) | throws com.foxit.sdk.PDFException

Remove the OCG state.

Parameters

  [in] | index | The index of OCG to remove. Valid range: from 0 to (count-1). count is returned by function SetOCGStateAction.getOCGStateCount .

Returns
  None.

## ◆ replaceOCGStates()

boolean com.foxit.sdk.pdf.actions.SetOCGStateAction.replaceOCGStates | ( | PDFDoc | document,
|  | int | index,
|  | PDFDictionaryArray | ocg_dict_array
| ) |  | throws com.foxit.sdk.PDFException

Replace the OCG states array.

Parameters

  [in] | document | A valid PDF document object.
  [in] | index | The index of OCG want to replace. Valid range: from 0 to (count-1). count is returned by function SetOCGStateAction.getOCGStateCount .
  [in] | ocg_dict_array | The OCG dictionary array to insert.

Returns
  true means is success, while false means not.

## ◆ setRadioButtonStatePreserved()

void com.foxit.sdk.pdf.actions.SetOCGStateAction.setRadioButtonStatePreserved | ( | boolean | is_preserved | ) | throws com.foxit.sdk.PDFException

Set the radio-button preserved state.

Parameters

  [in] | is_preserved | The preserved state value.

Returns
  None.