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 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 eventCore.Annotations.Forms.PDFJS.Event The embedded JS event that is used when executing the action documentViewerCore.DocumentViewer The DocumentViewer to use as context for the action execution -
ActionOptions
-
Options for creating an action
Type:
- Object
Properties:
Name Type Argument Description namestring <optional>
The action name -
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 eventCore.Annotations.Forms.PDFJS.Event 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 -
DestOptions
-
Options for creating a Dest
Type:
- Object
Properties:
Name Type Argument Description pagenumber <optional>
The page number for the destination fit'XYZ' | 'FitBH' | 'FitH' | 'FitBV' | 'FitV' | 'FitR' | 'Fit' | 'FitB' <optional>
The fit style topnumber <optional>
The top coordinate leftnumber <optional>
The left coordinate bottomnumber <optional>
The bottom coordinate rightnumber <optional>
The right coordinate zoomnumber <optional>
The zoom level namestring <optional>
The named destination name -
DestShape
-
Shape for Dest properties
Type:
- Object
Properties:
Name Type Argument Description pagenumber | string <optional>
The page number or name fitstring | number <optional>
The fit style topnumber <optional>
The top coordinate leftnumber <optional>
The left coordinate bottomnumber <optional>
The bottom coordinate rightnumber <optional>
The right coordinate zoomnumber | string <optional>
The zoom level namestring <optional>
The named destination name -
GoToOptions
-
Options for creating a GoTo action
Type:
- Object
Properties:
Name Type Argument Description destCore.Actions.DestOptions The destination namestring <optional>
The action name -
GoToROptions
-
Options for creating a GoToR action
Type:
- Object
Properties:
Name Type Argument Description destCore.Actions.DestOptions The destination in the remote document filenamestring The filename of the remote document newWindowboolean Whether to open the remote document in a new window namestring <optional>
The action name -
HideOptions
-
Options for creating a Hide action
Type:
- Object
Properties:
Name Type Argument Description fieldsArray.<string> The field names to show or hide hideboolean Whether to hide the fields namestring <optional>
The action name -
HideShape
-
Shape for Hide action properties
Type:
- Object
Properties:
Name Type Argument Description hideboolean Whether to hide the fields namestring The action name fieldsArray.<string> <optional>
The field names -
JavaScriptOptions
-
Options for creating a JavaScript action
Type:
- Object
Properties:
Name Type Argument Description javascriptstring The JavaScript code to execute namestring <optional>
The action name -
NamedOptions
-
Options for creating a Named action
Type:
- Object
Properties:
Name Type Argument Description actionstring The named action (NextPage, PrevPage, FirstPage, LastPage, or Print) namestring <optional>
The action name -
ResetFormOptions
-
Options for creating a ResetForm action
Type:
- Object
Properties:
Name Type Argument Description fieldsArray.<string> The field names to reset excludeboolean Whether to exclude the fields from being reset namestring <optional>
The action name -
ResetFormShape
-
Shape for ResetForm action properties
Type:
- Object
Properties:
Name Type Argument Description excludeboolean Whether to exclude the fields namestring The action name fieldsArray.<string> <optional>
The field names -
SubmitFormOptions
-
Options for creating a SubmitForm action
Type:
- Object
Properties:
Name Type Argument Description flagsArray.<string> The submission flags namestring <optional>
The action name urlstring <optional>
The URL to submit the form to fieldsArray.<string> <optional>
The field names to include or exclude format'fdf' | 'html' | 'xfdf' <optional>
The format to use for submission includeEmptyboolean <optional>
Whether to include empty fields method'POST' | 'GET' <optional>
The HTTP method to use excludeboolean <optional>
Whether to exclude the specified fields -
SubmitFormShape
-
Shape for SubmitForm action properties
Type:
- Object
Properties:
Name Type Argument Description namestring The action name urlstring <optional>
The URL to submit to fieldsArray.<string> <optional>
The field names formatstring <optional>
The submission format includeEmptyboolean <optional>
Whether to include empty fields methodstring <optional>
The HTTP method excludeboolean <optional>
Whether to exclude the fields flagsArray.<string> <optional>
The submission flags -
URIOptions
-
Options for creating a URI action
Type:
- Object
Properties:
Name Type Argument Description uristring The URI to open namestring <optional>
The action name