PDF kit command
form.addField
Prepare form: add a field
Add a form field on a page. type: text, date, checkbox, radio, combo, list, button, image (a picture placeholder; fill it with form_set_image), signature. rect in points from the top-left of the displayed page [x0, y0, x1, y1]. name defaults to the next free name (Text1, Check Box1, Group1, Dropdown1, List Box1, Button1, Image1, Signature1, Date1). Radio buttons join the radio group named by group (a new group otherwise) with the export value export. Returns the field's name. Undoable.
- Kit
- PDF 0.1.0 (.pdf)
- Changes the document
- yes
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
caption | string | no | Button label. |
editable | boolean | no | Combo box accepts typed text. |
export | string | no | Radio button export value (default Choice1). |
group | string | no | Radio group to join. |
multiSelect | boolean | no | |
multiline | boolean | no | |
name | string | no | |
options | string[] | no | Combo box / list box items. |
page | integer | yes | (minimum 1) |
rect | number[] | yes | (maxItems 4, minItems 4) |
type | "text" | "date" | "checkbox" | "radio" | "combo" | "list" | "button" | "image" | "signature" | yes |
Call through pdf_run
pdf_run {
"path": "<file>.pdf",
"steps": [{ "command": "form.addField", "params": { "page": <integer>, "rect": <number[]>, "type": <"text" | "date" | "checkbox" | "radio" | "combo" | "list" | "button" | "image" | "signature"> } }]
}The required parameters, with placeholders for their types: not a tested example. Optional: caption, editable, export, group, multiSelect, multiline, name, options. pdf_run answers the step’s result in completed[i].result.
Result
The kit gives no result schema for this command.
Parameter schema
{
"additionalProperties": false,
"properties": {
"caption": {
"description": "Button label.",
"type": "string"
},
"editable": {
"description": "Combo box accepts typed text.",
"type": "boolean"
},
"export": {
"description": "Radio button export value (default Choice1).",
"type": "string"
},
"group": {
"description": "Radio group to join.",
"type": "string"
},
"multiSelect": {
"type": "boolean"
},
"multiline": {
"type": "boolean"
},
"name": {
"type": "string"
},
"options": {
"description": "Combo box / list box items.",
"items": {
"type": "string"
},
"type": "array"
},
"page": {
"description": "(minimum 1)",
"type": "integer"
},
"rect": {
"description": "(maxItems 4, minItems 4)",
"items": {
"type": "number"
},
"type": "array"
},
"type": {
"enum": [
"text",
"date",
"checkbox",
"radio",
"combo",
"list",
"button",
"image",
"signature"
],
"type": "string"
}
},
"required": [
"page",
"rect",
"type"
],
"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.