---
title: "edit.batch: Edit in one step — PDF kit command — Kition"
description: "Run several commands on one document as one undo step, all or nothing: steps (1-1000), each a command id (as the document's command list names it, e.g. comment.add) and its params (doc is the batch's). A step that fails takes back the steps before it, and the batch changes nothing and leaves no undo step. label names the undo step (default: the first step's name). Undo, redo, batches and commands that open, close or save documents cannot be steps."
canonical: "https://developer.kition.ai/docs/kits/pdf/commands/edit.batch"
---

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

# edit.batch

**Edit in one step.** Run several commands on one document as one undo step, all or nothing: steps (1-1000), each a command id (as the document's command list names it, e.g. comment.add) and its params (doc is the batch's). A step that fails takes back the steps before it, and the batch changes nothing and leaves no undo step. label names the undo step (default: the first step's name). Undo, redo, batches and commands that open, close or save documents cannot be steps.

- 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 |
| --- | --- | --- | --- |
| `label` | `string` | no | The undo step's name. |
| `steps` | `object[]` | yes | (maxItems 1000, minItems 1) |

## Call through pdf_run

```text
pdf_run {
  "path": "<file>.pdf",
  "steps": [{ "command": "edit.batch", "params": { "steps": <object[]> } }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `label`. 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": {
    "label": {
      "description": "The undo step's name.",
      "type": "string"
    },
    "steps": {
      "description": "(maxItems 1000, minItems 1)",
      "items": {
        "additionalProperties": false,
        "properties": {
          "command": {
            "description": "A command id, e.g. comment.add.",
            "type": "string"
          },
          "params": {
            "additionalProperties": true,
            "description": "The command's parameters, without doc.",
            "type": "object"
          }
        },
        "required": [
          "command"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "steps"
  ],
  "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).
