Foxit PDF SDK
fsdk.AdditionalAction Class Reference

Public Member Functions

def DoJSAction (trigger)
 Perform javascript action which is specified by a trigger event type. More...
 
def GetAction (trigger)
 Get an action with specified trigger event type. More...
 
def GetDict ()
 Get the PDF dictionary of current object. More...
 
def IsEmpty ()
 Check whether current object is empty or not. More...
 
def RemoveAction (trigger)
 Remove an action with specified trigger event type. More...
 
def RemoveAllActions ()
 Remove all actions. More...
 
def SetAction (trigger, action)
 Set a additional-action for specified trigger event type. More...
 

Detailed Description

An annotation, page object, or (beginning with PDF 1.3) interactive form field may include an entry named "AA" which specifies an additional-actions dictionary (PDF 1.2) that extends the set of events that can trigger the execution of an action. In PDF 1.4, the document catalog dictionary may also contain an "AA" entry for trigger events affecting the document as a whole.
This class can be constructed from PDF document, PDF page, PDF form field, PDF annotation (only some types) or an existing additional-actions dictionary and can be used to get/set data from an additional-actions dictionary from PDF document, PDF page, PDF form field or PDF annotation.

Member Function Documentation

◆ DoJSAction()

def fsdk.AdditionalAction.DoJSAction (   trigger)

Perform javascript action which is specified by a trigger event type.

If current object is constructed with a valid PDF dictionary, current function will return false directly because Foxit PDF SDK cannot know which kind of object the additional action dictionary is associated with.

Parameters
[in]triggerThe input trigger event type. It should be:
Returns
true means success , while false means failure or current object is constructed from PDF dictionary.

◆ GetAction()

def fsdk.AdditionalAction.GetAction (   trigger)

Get an action with specified trigger event type.

Parameters
[in]triggerThe input trigger event type. It should be:
  • If current additional-action is constructed from PDF dictionary, the trigger value can be one of values defined in enum class TriggerEvent.

  • If current additional-action is constructed from PDF page, the trigger value must be one of values starting from fsdk.AdditionalActionE_TriggerPageOpened (with same prefix name).

  • If current additional-action is constructed from PDF document, the trigger value must be one of values starting from fsdk.AdditionalActionE_TriggerDocWillClose (with same prefix name).

  • If current additional-action is constructed from PDF form field, the trigger value must be one of values starting from fsdk.AdditionalActionE_TriggerFieldKeyStroke (with same prefix name).

  • If current additional-action is constructed from PDF annotation, the trigger value must be one of values starting from fsdk.AdditionalActionE_TriggerAnnotCursorEnter (with same prefix name).

Returns
An action object.

◆ GetDict()

def fsdk.AdditionalAction.GetDict ( )

Get the PDF dictionary of current object.

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

◆ IsEmpty()

def fsdk.AdditionalAction.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.

◆ RemoveAction()

def fsdk.AdditionalAction.RemoveAction (   trigger)

Remove an action with specified trigger event type.

If there is no action for input trigger event type when it is valid, this function will return true directly.

Parameters
[in]triggerThe input trigger event type. It should be:
  • If current additional-action is constructed from PDF dictionary, the trigger value can be one of values defined in enum class TriggerEvent.

  • If current additional-action is constructed from PDF page, the trigger value must be one of values starting from fsdk.AdditionalActionE_TriggerPageOpened (with same prefix name).

  • If current additional-action is constructed from PDF document, the trigger value must be one of values starting from fsdk.AdditionalActionE_TriggerDocWillClose (with same prefix name).

  • If current additional-action is constructed from PDF form field, the trigger value must be one of values starting from fsdk.AdditionalActionE_TriggerFieldKeyStroke (with same prefix name).

  • If current additional-action is constructed from PDF annotation, the trigger value must be one of values starting from fsdk.AdditionalActionE_TriggerAnnotCursorEnter (with same prefix name).

Returns
true means success , while false means failure.

◆ RemoveAllActions()

def fsdk.AdditionalAction.RemoveAllActions ( )

Remove all actions.

Returns
true means success , while false means failure.

◆ SetAction()

def fsdk.AdditionalAction.SetAction (   trigger,
  action 
)

Set a additional-action for specified trigger event type.

Parameters
[in]triggerThe input trigger event type. It should be:
  • If current additional-action is constructed from PDF dictionary, the trigger value can be one of values defined in enum class TriggerEvent.

  • If current additional-action is constructed from PDF page, the trigger value must be one of values starting from fsdk.AdditionalActionE_TriggerPageOpened (with same prefix name).

  • If current additional-action is constructed from PDF document, the trigger value must be one of values starting from fsdk.AdditionalActionE_TriggerDocWillClose (with same prefix name).

  • If current additional-action is constructed from PDF form field, the trigger value must be one of values starting from fsdk.AdditionalActionE_TriggerFieldKeyStroke (with same prefix name).

  • If current additional-action is constructed from PDF annotation, the trigger value must be one of values starting from fsdk.AdditionalActionE_TriggerAnnotCursorEnter (with same prefix name).

[in]actionAn action object to be set.
If current additional-action is constructed from PDF document or PDF form field, the type of this action should be fsdk.ActionE_TypeJavaScript .
If current additional-action is constructed from PDF page, PDF annotation, or PDF dictionary, please refer to comment of the trigger event to check if only specified type of action can be used. Usually, support following types as the new 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.