PDF kit command

bookmark.add

Add a bookmark

Add a bookmark that goes to a page, under a parent bookmark (or at the top level), at a position. Undoable.

Kit
PDF 0.1.0 (.pdf)
Changes the document
yes

Parameters

Parameters of bookmark.add
NameTypeRequiredDescription
pageintegeryes(minimum 1)
parentinteger[]noParent bookmark (omit for the top level): 1-based positions from the top level, e.g. [2, 1] = the first child of the second bookmark.
positionintegerno1-based position among the parent's children (default: last). (minimum 1)
titlestringyes(minLength 1)

Call through pdf_run

text
pdf_run {
  "path": "<file>.pdf",
  "steps": [{ "command": "bookmark.add", "params": { "page": <integer>, "title": <string> } }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: parent, position. 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": {
    "page": {
      "description": "(minimum 1)",
      "type": "integer"
    },
    "parent": {
      "description": "Parent bookmark (omit for the top level): 1-based positions from the top level, e.g. [2, 1] = the first child of the second bookmark.",
      "items": {
        "description": "(minimum 1)",
        "type": "integer"
      },
      "type": "array"
    },
    "position": {
      "description": "1-based position among the parent's children (default: last). (minimum 1)",
      "type": "integer"
    },
    "title": {
      "description": "(minLength 1)",
      "type": "string"
    }
  },
  "required": [
    "page",
    "title"
  ],
  "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.