---
title: "form.setProps: Field properties — PDF kit command — Kition"
description: "Change field properties: give field for one field, or fields for a list of unique field names (1–1000). A bulk change is atomic and one Undo step; an invalid or locked field leaves every field unchanged. Only the given properties change, and partial appearance changes preserve each field's other colours and font. name (rename), rect (position) and rotation require a single field. General and Options: tooltip, readOnly, required, multiline, maxLength (0 = no limit), options (combo/list items), fontSize (0 = auto), format, validate, calculate (the standard AF rules). Options: align (left, center, right), default (Reset form's value; check boxes/radio buttons use their on state, \"\" for off), flags { scroll, rich_text, password, file_select, spell_check, comb (needs maxLength), sort, editable, multi_select, commit_immediately }, checkStyle (check boxes/radio buttons: check, circle, cross, diamond, square, star). rotation is 0, 90, 180 or 270 degrees counterclockwise and swaps width/height when the axis changes. Undoable."
canonical: "https://developer.kition.ai/docs/kits/pdf/commands/form.setProps"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/pdf/commands/form.setProps](https://developer.kition.ai/docs/kits/pdf/commands/form.setProps)

# form.setProps

**Field properties.** Change field properties: give field for one field, or fields for a list of unique field names (1–1000). A bulk change is atomic and one Undo step; an invalid or locked field leaves every field unchanged. Only the given properties change, and partial appearance changes preserve each field's other colours and font. name (rename), rect (position) and rotation require a single field. General and Options: tooltip, readOnly, required, multiline, maxLength (0 = no limit), options (combo/list items), fontSize (0 = auto), format, validate, calculate (the standard AF rules). Options: align (left, center, right), default (Reset form's value; check boxes/radio buttons use their on state, "" for off), flags { scroll, rich_text, password, file_select, spell_check, comb (needs maxLength), sort, editable, multi_select, commit_immediately }, checkStyle (check boxes/radio buttons: check, circle, cross, diamond, square, star). rotation is 0, 90, 180 or 270 degrees counterclockwise and swaps width/height when the axis changes. Undoable.

- Kit: PDF 0.1.0 (.pdf); reference: [PDF kit commands](https://developer.kition.ai/docs/kits/pdf.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `align` | `"left" \| "center" \| "right"` | no |  |
| `appearance` | `object` | no | Appearance tab: border, fill, text_color (#RRGGBB, a name or "none"), width (0–12 points; 1 thin, 2 medium, 3 thick), style (solid, dashed, beveled, inset, underline), font (helvetica, times, courier). |
| `calculate` | `object \| "none"` | no | Calculate tab: {"op": "sum"\|"product"\|"average"\|"min"\|"max", "fields": ["a", "b"]}, {"notation": "Price * Qty"} (simplified field notation), or "none". |
| `checkStyle` | `"check" \| "circle" \| "cross" \| "diamond" \| "square" \| "star"` | no | Check boxes and radio buttons: the mark shown when on. |
| `default` | `string` | no |  |
| `field` | `string` | no | The field's current name. |
| `fields` | `string[]` | no | Apply the same changes to these fields in one atomic edit. Use either field or fields. (maxItems 1000, minItems 1) |
| `flags` | `object` | no |  |
| `fontSize` | `number` | no | (minimum 0) |
| `format` | `object \| "none"` | no | Format tab: {"type": "number", "decimals": 2, "currency": "$", "separator": 0-4, "negative": 0-3}, {"type": "percent"}, {"type": "date"\|"time", "pattern": "mm/dd/yyyy"}, {"type": "zip"\|"zip4"\|"phone"\|"ssn"}, {"type": "mask", "mask": "AA-9999"}, or "none". |
| `locked` | `boolean` | no | Lock the field's properties (only unlocking is accepted while locked). |
| `maxLength` | `integer` | no | (minimum 0) |
| `multiline` | `boolean` | no |  |
| `name` | `string` | no |  |
| `options` | `string[]` | no |  |
| `readOnly` | `boolean` | no |  |
| `rect` | `number[]` | no | Move/resize: points from the top-left of the displayed page. (maxItems 4, minItems 4) |
| `required` | `boolean` | no |  |
| `rotation` | `0 \| 90 \| 180 \| 270` | no | Widget rotation in degrees, counterclockwise. Changing between horizontal and vertical swaps the rectangle around its center. |
| `tooltip` | `string` | no |  |
| `validate` | `object \| "none"` | no | Validate tab: {"min": 0, "max": 100} (either may be left out) or "none". |

## Call through pdf_run

```text
pdf_run {
  "path": "<file>.pdf",
  "steps": [{ "command": "form.setProps" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `align`, `appearance`, `calculate`, `checkStyle`, `default`, `field`, `fields`, `flags`, `fontSize`, `format`, `locked`, `maxLength`, `multiline`, `name`, `options`, `readOnly`, `rect`, `required`, `rotation`, `tooltip`, `validate`. 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": {
    "align": {
      "enum": [
        "left",
        "center",
        "right"
      ],
      "type": "string"
    },
    "appearance": {
      "additionalProperties": true,
      "description": "Appearance tab: border, fill, text_color (#RRGGBB, a name or \"none\"), width (0–12 points; 1 thin, 2 medium, 3 thick), style (solid, dashed, beveled, inset, underline), font (helvetica, times, courier).",
      "type": "object"
    },
    "calculate": {
      "description": "Calculate tab: {\"op\": \"sum\"|\"product\"|\"average\"|\"min\"|\"max\", \"fields\": [\"a\", \"b\"]}, {\"notation\": \"Price * Qty\"} (simplified field notation), or \"none\".",
      "oneOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "enum": [
            "none"
          ],
          "type": "string"
        }
      ]
    },
    "checkStyle": {
      "description": "Check boxes and radio buttons: the mark shown when on.",
      "enum": [
        "check",
        "circle",
        "cross",
        "diamond",
        "square",
        "star"
      ],
      "type": "string"
    },
    "default": {
      "type": "string"
    },
    "field": {
      "description": "The field's current name.",
      "type": "string"
    },
    "fields": {
      "description": "Apply the same changes to these fields in one atomic edit. Use either field or fields. (maxItems 1000, minItems 1)",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "flags": {
      "additionalProperties": true,
      "type": "object"
    },
    "fontSize": {
      "description": "(minimum 0)",
      "type": "number"
    },
    "format": {
      "description": "Format tab: {\"type\": \"number\", \"decimals\": 2, \"currency\": \"$\", \"separator\": 0-4, \"negative\": 0-3}, {\"type\": \"percent\"}, {\"type\": \"date\"|\"time\", \"pattern\": \"mm/dd/yyyy\"}, {\"type\": \"zip\"|\"zip4\"|\"phone\"|\"ssn\"}, {\"type\": \"mask\", \"mask\": \"AA-9999\"}, or \"none\".",
      "oneOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "enum": [
            "none"
          ],
          "type": "string"
        }
      ]
    },
    "locked": {
      "description": "Lock the field's properties (only unlocking is accepted while locked).",
      "type": "boolean"
    },
    "maxLength": {
      "description": "(minimum 0)",
      "type": "integer"
    },
    "multiline": {
      "type": "boolean"
    },
    "name": {
      "type": "string"
    },
    "options": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "readOnly": {
      "type": "boolean"
    },
    "rect": {
      "description": "Move/resize: points from the top-left of the displayed page. (maxItems 4, minItems 4)",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "required": {
      "type": "boolean"
    },
    "rotation": {
      "description": "Widget rotation in degrees, counterclockwise. Changing between horizontal and vertical swaps the rectangle around its center.",
      "enum": [
        0,
        90,
        180,
        270
      ],
      "type": "integer"
    },
    "tooltip": {
      "type": "string"
    },
    "validate": {
      "description": "Validate tab: {\"min\": 0, \"max\": 100} (either may be left out) or \"none\".",
      "oneOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "enum": [
            "none"
          ],
          "type": "string"
        }
      ]
    }
  },
  "type": "object"
}
```

Generated from the command list of @kition/pdf-darwin-arm64@0.1.0 and the kit itself (pdf_commands through @kition/cli@0.1.1, built from KitionAI/kition-pdf@b0d2725).
