PDF kit command

object.move

Move objects together

Atomically translate 1–1000 mixed references from object.list by [dx, dy] in displayed points (right/down). Preserves glyph codes, fonts, image data and relative spacing; success is one undo step. Clipping and vertical text are refused. A bad/stale reference refuses the entire move.

Kit
PDF 0.1.0 (.pdf)
Changes the document
yes

Parameters

Parameters of object.move
NameTypeRequiredDescription
generationintegernoUse generation returned by object.list to reject a stale selection. (minimum 0)
objectsobject[]yes(maxItems 1000, minItems 1)
offsetnumber[]yes(maxItems 2, minItems 2)
pageintegeryes(minimum 1)

Call through pdf_run

text
pdf_run {
  "path": "<file>.pdf",
  "steps": [{ "command": "object.move", "params": { "objects": <object[]>, "offset": <number[]>, "page": <integer> } }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: generation. 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": {
    "generation": {
      "description": "Use generation returned by object.list to reject a stale selection. (minimum 0)",
      "type": "integer"
    },
    "objects": {
      "description": "(maxItems 1000, minItems 1)",
      "items": {
        "additionalProperties": false,
        "properties": {
          "index": {
            "description": "(minimum 1)",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "added",
              "text",
              "image"
            ],
            "type": "string"
          }
        },
        "required": [
          "index",
          "kind"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "offset": {
      "description": "(maxItems 2, minItems 2)",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "page": {
      "description": "(minimum 1)",
      "type": "integer"
    }
  },
  "required": [
    "objects",
    "offset",
    "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.