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
| Name | Type | Required | Description |
|---|---|---|---|
color | string | no | |
highlight | "none" | "invert" | "outline" | "inset" | no | |
page | integer | yes | (minimum 1) |
rect | number[] | yes | (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.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.