Foxit PDF SDK
fsdk.Action Class Reference

Public Member Functions

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

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 Action is the base class for all kinds of PDF actions. For concrete action types, please refer to derived classes. Function fsdk.ActionCreate 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

◆ GetDict()

def fsdk.Action.GetDict ( )

Get PDF dictionary of current object.

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

◆ GetDocument()

def fsdk.Action.GetDocument ( )

Get the PDF document, to which current action belongs.

Returns
A PDF document object.

◆ GetSubAction()

def fsdk.Action.GetSubAction (   index)

Get a sub-action by index.

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

def fsdk.Action.GetSubActionCount ( )

Get the count of sub-actions.

Returns
Count of sub-actions.

◆ GetType()

def fsdk.Action.GetType ( )

Get action type.

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

◆ InsertSubAction()

def fsdk.Action.InsertSubAction (   index,
  sub_action 
)

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

Parameters
[in]indexIndex 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_actionNew sub-action to be inserted. Currently only support following types as the new sub-action:
fsdk.ActionE_TypeGoto , fsdk.ActionE_TypeURI , fsdk.ActionE_TypeJavaScript , fsdk.ActionE_TypeNamed , fsdk.ActionE_TypeGoToR , fsdk.ActionE_TypeGoToE , fsdk.ActionE_TypeSubmitForm , fsdk.ActionE_TypeResetForm , fsdk.ActionE_TypeHide , fsdk.ActionE_TypeLaunch , fsdk.ActionE_TypeImportData , fsdk.ActionE_TypeRendition .
Returns
None.

◆ IsEmpty()

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

def fsdk.Action.RemoveAllSubActions ( )

Remove all the sub-actions.

Returns
None.

◆ RemoveSubAction()

def fsdk.Action.RemoveSubAction (   index)

Remove a sub-action, specified by index.

Parameters
[in]indexIndex of sub-action to be retrieved. Valid range: from 0 to (count-1). count is returned by function fsdk.Action.GetSubActionCount .
Returns
None.

◆ SetSubAction()

def fsdk.Action.SetSubAction (   index,
  sub_action 
)

Set a sub-action by index.

Parameters
[in]indexIndex of sub-action to be retrieved. Valid range: from 0 to (count-1). count is returned by function fsdk.Action.GetSubActionCount .
[in]sub_actionAn action object to be set as a sub-action. Currently only support following types as sub-action:
fsdk.ActionE_TypeGoto , fsdk.ActionE_TypeURI , fsdk.ActionE_TypeJavaScript , fsdk.ActionE_TypeNamed , fsdk.ActionE_TypeGoToR , fsdk.ActionE_TypeGoToE , fsdk.ActionE_TypeSubmitForm , fsdk.ActionE_TypeResetForm , fsdk.ActionE_TypeHide , fsdk.ActionE_TypeLaunch , fsdk.ActionE_TypeImportData , fsdk.ActionE_TypeRendition , fsdk.ActionE_TypeSetOCGState .
Returns
None.