PDF kit command

link.add

Add a link

Add a link over rect on page that opens url or goes to toPage. Appearance: visible (rectangle), color, width 1-3, highlight none/invert/outline/inset. Undoable.

Kit
PDF 0.1.0 (.pdf)
Changes the document
yes

Parameters

Parameters of link.add
NameTypeRequiredDescription
colorstringno
highlight"none" | "invert" | "outline" | "inset"no
pageintegeryes(minimum 1)
rectnumber[]yes(maxItems 4, minItems 4)
toPageintegerno(minimum 1)
urlstringno
visiblebooleanno
widthnumberno

Call through pdf_run

text
pdf_run {
  "path": "<file>.pdf",
  "steps": [{ "command": "link.add", "params": { "page": <integer>, "rect": <number[]> } }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: color, highlight, toPage, url, visible, 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": {
      "type": "string"
    },
    "highlight": {
      "enum": [
        "none",
        "invert",
        "outline",
        "inset"
      ],
      "type": "string"
    },
    "page": {
      "description": "(minimum 1)",
      "type": "integer"
    },
    "rect": {
      "description": "(maxItems 4, minItems 4)",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "toPage": {
      "description": "(minimum 1)",
      "type": "integer"
    },
    "url": {
      "type": "string"
    },
    "visible": {
      "type": "boolean"
    },
    "width": {
      "type": "number"
    }
  },
  "required": [
    "page",
    "rect"
  ],
  "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.