Class Actions.Dispatcher
Actions.Dispatcher
Constructor Attributes | Constructor Name and Description |
---|---|
Actions.Dispatcher(options)
A subclass or mixin that enables many different classes to construct and dispatch PDF Actions.
|
Method Attributes | Method Name and Description |
---|---|
addAction(trigger, action)
Add a single action to a trigger.
|
|
addActions(actions)
Add the actions to the dispatcher so they run on next trigger, constructing them if necessary
|
|
[deprecated] |
addActionsFromXfdf(widgetElement, pageMatrix)
Read and instantiate actions from XFDF.
|
Get all the actions associated with this dispatcher.
|
|
Get the associated DocumentViewer.
|
|
[deprecated] |
saveActionsToXfdf(widgetElement, pageMatrix, overrideElement)
Save the actions associated with this Dispatcher to an XFDF DOM element.
|
setDocumentViewer(documentViewer)
Set the internal DocumentViewer reference, which is required for some actions to execute correctly.
|
|
triggerAction(trigger, event)
Trigger all the actions associated with the given trigger, passing the event provided.
|
Class Detail
Actions.Dispatcher(options)
A subclass or mixin that enables many different classes to construct and dispatch PDF Actions.
- Parameters:
- options
Method Detail
addAction(trigger, action)
Add a single action to a trigger.
- Parameters:
- {string} trigger
- The name of the trigger to which to add the action.
- {(Actions.Action|object)} action
- The action to add, or an object representing the desired properties (including a name)
addActions(actions)
Add the actions to the dispatcher so they run on next trigger, constructing them if necessary
- Parameters:
- {object} actions
- The actions to add, as an object with triggers for keys and arrays of action-describing objects for values.
addActionsFromXfdf(widgetElement, pageMatrix)
Read and instantiate actions from XFDF.
- Parameters:
- {Element} widgetElement
- The widget element to read from
- {XODText.Matrix2D} pageMatrix
- The widget's page's transormation matrix
- Deprecated:
- due to PDFInfo
{object}
getActions()
Get all the actions associated with this dispatcher.
- Returns:
- {object} The associated actions (in the same format as addActions)
{CoreControls.DocumentViewer}
getDocumentViewer()
Get the associated DocumentViewer.
- Returns:
- {CoreControls.DocumentViewer} The associated DocumentViewer instance
saveActionsToXfdf(widgetElement, pageMatrix, overrideElement)
Save the actions associated with this Dispatcher to an XFDF DOM element.
- Parameters:
- {Element} widgetElement
- The element to which to write the actions
- {XODText.Matrix2D} pageMatrix
- The widget's page's transformation matrix
- {?Element} overrideElement
- An optional other element to write to. If not provided, an OnActivation element will be added to widgetElement
- Deprecated:
- due to PDFInfo
setDocumentViewer(documentViewer)
Set the internal DocumentViewer reference, which is required for some actions to execute correctly.
- Parameters:
- {CoreControls.DocumentViewer} documentViewer
- The DocumentViewer instance
triggerAction(trigger, event)
Trigger all the actions associated with the given trigger, passing the event provided.
- Parameters:
- {string} trigger
- The trigger to trigger
- {Annotations.Forms.PDFJS.Event} event
- The event to pass to each action