PDF kit command

measure.distance

Measure distance

Add an undoable two-point distance annotation using the scale of the first point's viewport.

Kit
PDF 0.1.0 (.pdf)
Changes the document
yes

Parameters

Parameters of measure.distance
NameTypeRequiredDescription
authorstringno(maxLength 512)
labelstringno(maxLength 512)
pageintegeryes(minimum 1)
pointsnumber[][]yes(maxItems 2048, minItems 1)

Call through pdf_run

text
pdf_run {
  "path": "<file>.pdf",
  "steps": [{ "command": "measure.distance", "params": { "page": <integer>, "points": <number[][]> } }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: author, 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": {
    "author": {
      "description": "(maxLength 512)",
      "type": "string"
    },
    "label": {
      "description": "(maxLength 512)",
      "type": "string"
    },
    "page": {
      "description": "(minimum 1)",
      "type": "integer"
    },
    "points": {
      "description": "(maxItems 2048, minItems 1)",
      "items": {
        "description": "[x, y] in points from the top-left of the displayed page. (maxItems 2, minItems 2)",
        "items": {
          "type": "number"
        },
        "type": "array"
      },
      "type": "array"
    }
  },
  "required": [
    "page",
    "points"
  ],
  "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.