FoxitPDFSDKforWeb v11.0.1
Foxit PDF SDK for Web
AdditionalAction< T > Class Reference

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. More...

Public Member Functions

async addAction (triggerEvent:ActionTriggerEvents, actionSpec:ActionSpecification)
 This method allows you to add an action to the specified trigger event type. More...
 
 getActions< E extends readonly ActionTriggerEvents[]> (triggerEvents?:E)
 Retrieves actions for the specified trigger event type. More...
 
async removeAction (triggerEvent:ActionTriggerEvents, targetActionObjNumber?:number)
 Removes action for the specified trigger event type. If the targetActionObjNumber is not provided, all actions for the specified trigger event type will be removed. If the targetActionObjNumber is provided, only the action with that object number will be removed. More...
 
async setAction (triggerEvent:ActionTriggerEvents, actionSpec:ActionSpecification)
 Sets an additional action for specified trigger event type. More...
 
async updateActionData (triggerEvent:ActionTriggerEvents, actionObjectNumber:number, actionData:ActionData)
 Updates an existing action data for the specified trigger event type and action object number. This method allows you to modify the data of an existing action. 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.

The instance of this class can be retrived from PDFDoc, PDFPage, PDFFormField, Annot (only some types) and can be used to get/set data from an additional-actions dictionary from PDF document, PDF page, PDF form field or PDF annotation.

Notes on trigger event types:
The applicable trigger event type depends on the source of the additional action:
Notes on ActionSpecification
The action specification object defines the action type and associated data to be executed when the trigger event occurs:
Since
11.0.0
Template Parameters
T- A generic type extending ActionTriggerEvents
See also
PDFDoc.getAdditionalAction
PDFFormField.getAdditionalAction
Widget.getAdditionalAction
Screen.getAdditionalAction

Member Function Documentation

◆ addAction()

async AdditionalAction< T >::addAction (   triggerEvent:ActionTriggerEvents,
  actionSpec:ActionSpecification 
)
inline

This method allows you to add an action to the specified trigger event type.

Parameters
triggerEventActionTriggerEvents - The trigger event type for which the action is to be appended. If there is already an action for the specified trigger event type, the new action will be a sub-action of the existing action. If there is no action for the specified trigger event type, the new action will be set to the AdditionalAction. For details about triggerEvent and actionSpec, please refer to the description of AdditionalAction.
actionSpecActionSpecification - The action specification object that defines the action to be added.
Note
Currently we don't support to create an embedded goto action (type: ActionType.gotoE).
Since
11.0.0

◆ getActions< E extends readonly ActionTriggerEvents[]>()

AdditionalAction< T >::getActions< E extends readonly ActionTriggerEvents[]> (   triggerEvents?:E)
inline

Retrieves actions for the specified trigger event type.

Parameters
[triggerEvents]ActionTriggerEvents[] - Optional array of trigger events to filter the actions. If not provided, all supported trigger events will be used.
Returns
Promise<ActionSpecification[]> - Resolves with the actions associated with the specified trigger events.
Since
11.0.0

◆ removeAction()

async AdditionalAction< T >::removeAction (   triggerEvent:ActionTriggerEvents,
  targetActionObjNumber?:number 
)
inline

Removes action for the specified trigger event type. If the targetActionObjNumber is not provided, all actions for the specified trigger event type will be removed. If the targetActionObjNumber is provided, only the action with that object number will be removed.

Parameters
triggerEventActionTriggerEvents - The trigger event type.
[targetActionObjNumber]number - Optional. The specific action object number to be removed. If not provided, all actions for the trigger event will be removed.
Returns
Promise<boolean> - Resolves to true if the action was successfully removed, false otherwise.

◆ setAction()

async AdditionalAction< T >::setAction (   triggerEvent:ActionTriggerEvents,
  actionSpec:ActionSpecification 
)
inline

Sets an additional action for specified trigger event type.

Note
For details about triggerEvent and actionSpec, please refer to the description of AdditionalAction.
Parameters
triggerEventActionTriggerEvents - The trigger event type for which the action is to be set.
actionSpecActionSpecification - The action specification object that defines the action to be set.
Since
11.0.0

◆ updateActionData()

async AdditionalAction< T >::updateActionData (   triggerEvent:ActionTriggerEvents,
  actionObjectNumber:number,
  actionData:ActionData 
)
inline

Updates an existing action data for the specified trigger event type and action object number. This method allows you to modify the data of an existing action.

Parameters
triggerEventT - The trigger event type for which the action data is to be updated.
actionObjectNumbernumber - The object number of the action to be updated.
actionDataActionData - the data of the action to be updated
Returns
Promise<void> - Resolves when the action is successfully updated.
Since
11.0.0

Foxit Software Corporation Logo
@2025 Foxit Software Incorporated. All rights reserved.