---
title: "link.edit: Edit a link — PDF kit command — Kition"
description: "Change a link's rect, destination (url or toPage) or appearance. Undoable."
canonical: "https://developer.kition.ai/docs/kits/pdf/commands/link.edit"
---

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

# link.edit

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

- Kit: PDF 0.1.0 (.pdf); reference: [PDF kit commands](https://developer.kition.ai/docs/kits/pdf.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `color` | `string` | no |  |
| `highlight` | `"none" \| "invert" \| "outline" \| "inset"` | no |  |
| `index` | `integer` | yes | (minimum 1) |
| `page` | `integer` | yes | (minimum 1) |
| `rect` | `number[]` | no | (maxItems 4, minItems 4) |
| `toPage` | `integer` | no | (minimum 1) |
| `url` | `string` | no |  |
| `visible` | `boolean` | no |  |
| `width` | `number` | no |  |

## 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/pdf-darwin-arm64@0.1.0 and the kit itself (pdf_commands through @kition/cli@0.1.1, built from KitionAI/kition-pdf@b0d2725).
