---
title: "comment.edit: Edit a comment — PDF kit command — Kition"
description: "Change a comment's text, colour, opacity, line width, fill (rectangle/oval/polygon; \"none\" removes it), rectangle (rectangle/oval/text box/stamp) or position (`move` [dx, dy] in points). Stamps keep their original appearance when resized. One undo step."
canonical: "https://developer.kition.ai/docs/kits/pdf/commands/comment.edit"
---

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

# comment.edit

**Edit a comment.** Change a comment's text, colour, opacity, line width, fill (rectangle/oval/polygon; "none" removes it), rectangle (rectangle/oval/text box/stamp) or position (`move` [dx, dy] in points). Stamps keep their original appearance when resized. One undo step.

- Kit: PDF 0.1.0 (.pdf); reference: [PDF kit commands](https://developer.kition.ai/docs/kits/pdf.md)
- Changes the document: yes
- Acts on: `id` (one id), which a run step’s `on` fills

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `color` | `string` | no | #RRGGBB or a name: yellow, red, orange, green, blue, purple, pink, black, gray, white. |
| `contents` | `string` | no |  |
| `fill` | `string` | no | Interior colour of a rectangle, oval or polygon: #RRGGBB, a colour name, or "none" for no fill. |
| `id` | `string` | no | The comment's id (from comment.list). |
| `index` | `integer` | no | 1-based position on the page, as comment.list reports. (minimum 1) |
| `move` | `number[]` | no | [x, y] in points from the top-left of the displayed page. (maxItems 2, minItems 2) |
| `opacity` | `number` | no | (maximum 1, minimum 0) |
| `page` | `integer` | no | With `index`, instead of `id`. (minimum 1) |
| `rect` | `number[]` | no | (maxItems 4, minItems 4) |
| `width` | `number` | no | (minimum 0) |

## Call through pdf_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: `color`, `contents`, `fill`, `id`, `index`, `move`, `opacity`, `page`, `rect`, `width`. 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": {
    "color": {
      "description": "#RRGGBB or a name: yellow, red, orange, green, blue, purple, pink, black, gray, white.",
      "type": "string"
    },
    "contents": {
      "type": "string"
    },
    "fill": {
      "description": "Interior colour of a rectangle, oval or polygon: #RRGGBB, a colour name, or \"none\" for no fill.",
      "type": "string"
    },
    "id": {
      "description": "The comment's id (from comment.list).",
      "type": "string",
      "x-khp-types": [
        "Comment"
      ]
    },
    "index": {
      "description": "1-based position on the page, as comment.list reports. (minimum 1)",
      "type": "integer"
    },
    "move": {
      "description": "[x, y] in points from the top-left of the displayed page. (maxItems 2, minItems 2)",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "opacity": {
      "description": "(maximum 1, minimum 0)",
      "type": "number"
    },
    "page": {
      "description": "With `index`, instead of `id`. (minimum 1)",
      "type": "integer"
    },
    "rect": {
      "description": "(maxItems 4, minItems 4)",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "width": {
      "description": "(minimum 0)",
      "type": "number"
    }
  },
  "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).
