PDF kit command

script.run

Run JavaScript

Run Acrobat JavaScript in the document, as the JavaScript console does (or as push button `field`'s Mouse Up script when field is given; on a laid-out XFA form, `field` runs that button's XFA click script instead, JavaScript or FormCalc, which can add and remove rows and show or hide subforms). The form object model is available: this/getField, event, app, util, console, display, color, and the document-level scripts. Field changes and resetForm are applied as one undoable step; returns the script's alerts, console output, requests (print, page, url, submit) and error.

Kit
PDF 0.1.0 (.pdf)
Changes the document
yes

Parameters

Parameters of script.run
NameTypeRequiredDescription
fieldstringnoRun as this button's Mouse Up event.
scriptstringyes

Call through pdf_run

text
pdf_run {
  "path": "<file>.pdf",
  "steps": [{ "command": "script.run", "params": { "script": <string> } }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: field. pdf_run answers the step’s result in completed[i].result.

Result

The kit gives no result schema for this command.

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "field": {
      "description": "Run as this button's Mouse Up event.",
      "type": "string"
    },
    "script": {
      "type": "string"
    }
  },
  "required": [
    "script"
  ],
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (pdf_commands through @kition/[email protected], built from KitionAI/kition-pdf@b0d2725). As data: commands.jsonl.