PDF kit command

link.edit

Edit a link

Change a link's rect, destination (url or toPage) or appearance. Undoable.

Kit
PDF 0.1.0 (.pdf)
Changes the document
yes

Parameters

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

Call through pdf_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: color, highlight, rect, 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"
    },
    "index": {
      "description": "(minimum 1)",
      "type": "integer"
    },
    "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": [
    "index",
    "page"
  ],
  "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.