Foxit PDF SDK

Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
FSDK.Action Class Reference
Inheritance diagram for FSDK.Action:

## Public Member Functions
| constructor (document, action_dict)
| Constructor, with parameters. More...
| GetDict ()
| Get PDF dictionary of current object. More...
| GetDocument ()
| Get the PDF document, to which current action belongs. More...
| GetSubAction (index)
| Get a sub-action by index. More...
| GetSubActionCount ()
| Get the count of sub-actions. More...
| GetType ()
| Get action type. More...
| InsertSubAction (index, sub_action)
| Insert a new sub-action to the location specified by index. More...
| IsEmpty ()
| Check whether current object is empty or not. More...
| RemoveAllSubActions ()
| Remove all the sub-actions. More...
| RemoveSubAction (index)
| Remove a sub-action, specified by index. More...
| SetSubAction (index, sub_action)
| Set a sub-action by index. More...

## Static Public Member Functions
static | Create (document, action_type)
| Create a new action, for specified action type. More...

## Static Public Attributes
static | e_NewWindowFlagFalse
| Enumeration for new window flag. More...
static | e_NewWindowFlagNone
| No "NewWindow" flag.
static | e_NewWindowFlagTrue
| "NewWindow" flag is true.
static | e_TypeGoto
| Action type: go-to action.
static | e_TypeGoTo3DView
| Action type: go-to-3D-view action.
static | e_TypeGoToE
| Action type: embedded go-to action.
static | e_TypeGoToR
| Action type: remote go-to action.
static | e_TypeHide
| Action type: hide action.
static | e_TypeImportData
| Action type: import-data action.
static | e_TypeJavaScript
| Action type: JavaScript action.
static | e_TypeLaunch
| Action type: launch action.
static | e_TypeMovie
| Action type: movie action.
static | e_TypeNamed
| Action type: named action.
static | e_TypeRendition
| Action type: rendition action.
static | e_TypeResetForm
| Action type: reset-form action.
static | e_TypeSetOCGState
| Action type: set-OCG-state action.
static | e_TypeSound
| Action type: sound action.
static | e_TypeSubmitForm
| Action type: submit-form action.
static | e_TypeThread
| Action type: thread action.
static | e_TypeTrans
| Action type: transition action.
static | e_TypeUnknown
| Enumeration for action type. More...
static | e_TypeURI
| Action type: uniform resource identifier (URI) action.

## Detailed Description

PDF supports following standard action types:
"Go-To Action", "Remote Go-To Action", "Embedded Go-To Action", "Launch Action", "Thread Action", "URI Action", "Sound Action","Movie Action", "Hide Action", "Named Action", "Submit-Form Action", "Reset-Form Action", "Import-Data Action", "JavaScript Action", "Set-OCG-State Action", "Rendition Action","Transition Action","Go-To-3D-View Action".
A PDF action may have sub-actions. When this action is triggered, its sub-actions should also be triggered in turn.
Class FSDK.Action is the base class for all kinds of PDF actions. For concrete action types, please refer to derived classes. Function FSDK.Action.Create can be used to create a new action – currently only support some action types. Please refer to comment of this function for more details. This class also offers functions to modify sub-actions.

## Member Function Documentation

## ◆ constructor()

FSDK.Action.constructor | ( | document | ,
|  | action_dict |
| ) |  |

Constructor, with parameters.

Parameters

  [in] | document | A valid PDF document object.
  [in] | action_dict | A PDF dictionary object that represents an action.

## ◆ Create()

static FSDK.Action.Create | ( | document | ,
|  | action_type |
| ) |  |
| static

Create a new action, for specified action type.

The newly created action has no action data (except action type) yet. User needs to call the functions in concrete action classes to set action data.

Parameters

  [in] | document | A valid PDF document, to which the new action belongs.
  [in] | action_type | Action type, used to specify which type of action is to be created. Currently only support: FSDK.Action.e_TypeGoto, FSDK.Action.e_TypeURI, FSDK.Action.e_TypeJavaScript, FSDK.Action.e_TypeNamed, FSDK.Action.e_TypeGoToR, FSDK.Action.e_TypeGoToE, FSDK.Action.e_TypeSubmitForm, FSDK.Action.e_TypeResetForm, FSDK.Action.e_TypeHide, FSDK.Action.e_TypeLaunch, FSDK.Action.e_TypeImportData, FSDK.Action.e_TypeRendition.

Returns
  A new action object, with no action data.

## ◆ GetDict()

FSDK.Action.GetDict | ( |  | ) |

Get PDF dictionary of current object.

Returns
  The PDF dictionary.If there is any error, this function will return null.

## ◆ GetDocument()

FSDK.Action.GetDocument | ( |  | ) |

Get the PDF document, to which current action belongs.

Returns
  A PDF document object.

## ◆ GetSubAction()

FSDK.Action.GetSubAction | ( | index |  | ) |

Get a sub-action by index.

Parameters

  [in] | index | Index of sub-action to be retrieved. Valid range: from 0 to (count-1). count is returned by function FSDK.Action.GetSubActionCount.

Returns
  An action object that represents the specified sub-action.

## ◆ GetSubActionCount()

FSDK.Action.GetSubActionCount | ( |  | ) |

Get the count of sub-actions.

Returns
  Count of sub-actions.

## ◆ GetType()

FSDK.Action.GetType | ( |  | ) |

Get action type.

Returns
  Action type. Please refer to values starting from FSDK.Action.e_TypeGoto and this would be one of these values.

## ◆ InsertSubAction()

FSDK.Action.InsertSubAction | ( | index | ,
|  | sub_action |
| ) |  |

Insert a new sub-action to the location specified by index.

Parameters

  [in] | index | Index of the location, where the new sub-action is inserted. If this index value is below zero, the new sub-action will be inserted to be the first. If this index value equals or larger than current sub-action count, the new sub-action will be inserted to be the last.
  [in] | sub_action | New sub-action to be inserted. Currently only support following types as the new sub-action: FSDK.Action.e_TypeGoto, FSDK.Action.e_TypeURI, FSDK.Action.e_TypeJavaScript, FSDK.Action.e_TypeNamed, FSDK.Action.e_TypeGoToR, FSDK.Action.e_TypeGoToE, FSDK.Action.e_TypeSubmitForm, FSDK.Action.e_TypeResetForm, FSDK.Action.e_TypeHide, FSDK.Action.e_TypeLaunch, FSDK.Action.e_TypeImportData, FSDK.Action.e_TypeRendition.

Returns
  None.

## ◆ IsEmpty()

FSDK.Action.IsEmpty | ( |  | ) |

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
  true means current object is empty, while false means not.

## ◆ RemoveAllSubActions()

FSDK.Action.RemoveAllSubActions | ( |  | ) |

Remove all the sub-actions.

Returns
  None.

## ◆ RemoveSubAction()

FSDK.Action.RemoveSubAction | ( | index |  | ) |

Remove a sub-action, specified by index.

Parameters

  [in] | index | Index of sub-action to be retrieved. Valid range: from 0 to (count-1). count is returned by function FSDK.Action.GetSubActionCount.

Returns
  None.

## ◆ SetSubAction()

FSDK.Action.SetSubAction | ( | index | ,
|  | sub_action |
| ) |  |

Set a sub-action by index.

Parameters

  [in] | index | Index of sub-action to be retrieved. Valid range: from 0 to (count-1). count is returned by function FSDK.Action.GetSubActionCount.
  [in] | sub_action | An action object to be set as a sub-action. Currently only support following types as sub-action: FSDK.Action.e_TypeGoto, FSDK.Action.e_TypeURI, FSDK.Action.e_TypeJavaScript, FSDK.Action.e_TypeNamed, FSDK.Action.e_TypeGoToR, FSDK.Action.e_TypeGoToE, FSDK.Action.e_TypeSubmitForm, FSDK.Action.e_TypeResetForm, FSDK.Action.e_TypeHide, FSDK.Action.e_TypeLaunch, FSDK.Action.e_TypeImportData, FSDK.Action.e_TypeRendition.

Returns
  None.

## Member Data Documentation

## ◆ e_NewWindowFlagFalse

FSDK.Action.e_NewWindowFlagFalse
| static

Enumeration for new window flag.

Values of this enumeration should be used alone.

"NewWindow" flag is false.

## ◆ e_TypeUnknown

FSDK.Action.e_TypeUnknown
| static

Enumeration for action type.

Values of this enumeration should be used alone.

Action type: unknown action.