PDF kit command

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)
Changes the document
yes
Acts on
id (one id), which a run step’s on fills

Parameters

Parameters of comment.edit
NameTypeRequiredDescription
colorstringno#RRGGBB or a name: yellow, red, orange, green, blue, purple, pink, black, gray, white.
contentsstringno
fillstringnoInterior colour of a rectangle, oval or polygon: #RRGGBB, a colour name, or "none" for no fill.
idstringnoThe comment's id (from comment.list).
indexintegerno1-based position on the page, as comment.list reports. (minimum 1)
movenumber[]no[x, y] in points from the top-left of the displayed page. (maxItems 2, minItems 2)
opacitynumberno(maximum 1, minimum 0)
pageintegernoWith `index`, instead of `id`. (minimum 1)
rectnumber[]no(maxItems 4, minItems 4)
widthnumberno(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/[email protected] and the kit itself (pdf_commands through @kition/[email protected], built from KitionAI/kition-pdf@b0d2725). As data: commands.jsonl.