The namespace for anything to do with PDF actions and action dispatch.
Actions can be defined by providing a JavaScript object that has the desired properties, and a name property defining the action subtype it represents. See documentation for specific action types for allowable properties.
Classes
Mixins
Members
-
<static> OnTriggeredAdditionalOptions
-
Additional options passed to the onTriggered handler.
Properties:
Name Type Description originalOnTriggeredCore.Actions.ActionOnTriggeredHandler The original onTriggered function of this action actionCore.Actions.Action The action that is being triggered
Methods
-
<static> setCustomOnTriggeredHandler(actionClass, onTriggeredHandler)
-
Sets a custom handler function that will be called when an action of the specified type is triggered.
Parameters:
Name Type Description actionClassCore.Actions.Action The class (constructor) of the action onTriggeredHandlerCore.Actions.CustomActionOnTriggeredHandler A handler function that will be called when the an action of the specified type is triggered Example
Actions.setCustomOnTriggeredHandler(Actions.URI, (target, event, documentViewer, options) => { if (target instanceof Annotations.Link) { // Don't do anything if the action is triggered by a link return; } options.originalOnTriggered(target, event, documentViewer) });
Type Definitions
-
ActionOnTriggeredHandler(target, event, documentViewer)
-
The onTriggered function for actions.
Parameters:
Name Type Description targetCore.Annotations.Forms.Field | Core.DocumentViewer The dispatcher to which this action is attached eventobject The embedded JS event that is used when executing the action documentViewerCore.DocumentViewer The DocumentViewer to use as context for the action execution -
CustomActionOnTriggeredHandler(target, event, documentViewer, options)
-
Handler function that gets passed to Core.Actions.setCustomOnTriggeredHandler. The signature is similar to onTriggered except with an additional options parameter.
Parameters:
Name Type Description targetCore.Annotations.Forms.Field | Core.DocumentViewer The object that the action has been triggered on eventobject The embedded JS event that is used when executing the action documentViewerCore.DocumentViewer The DocumentViewer to use as context for the action execution optionsCore.Actions.OnTriggeredAdditionalOptions Additional options and parameters Properties
Name Type Description actionCore.Actions.Action The action object that is being triggered originalOnTriggeredCore.Actions.ActionOnTriggeredHandler The original onTriggered function of this action