Constructor
Run arbitrary JavaScript.
Parameters:
Name | Type | Description |
---|---|---|
args |
object |
Examples
const action = new PSPDFKit.Actions.JavaScriptAction({
script: "alert(...)"
});
const widget = new PSPDFKit.Annotations.WidgetAnnotation({
id: PSPDFKit.generateInstantId(),
pageIndex: 0,
formFieldName: "buttonIcon",
boundingBox: new PSPDFKit.Geometry.Rect({
left: 100,
top: 200,
width: 100,
height: 100
}),
action: new PSPDFKit.Actions.JavaScriptAction({
script: "event.target.buttonImportIcon()"
}),
borderWidth: 0
});
const formField = new PSPDFKit.FormFields.ButtonFormField({
name: "buttonIcon",
annotationIds: PSPDFKit.Immutable.List([widget.id])
});
await instance.create([widget, formField]);
Extends
Members
Members
The JavaScript to run.
Type:
- string
Actions can be chained by adding them to this immutable List.
Type:
- PSPDFKit.Immutable.List.<Action>
- Inherited From: