PDF kit command

content.set

Edit added content

Move/resize (rect), retype (text) or restyle (font, size, bold, italic, color, align) an added item (page, index from content.list). Images: rotate (degrees, multiple of 90, counter-clockwise), flipH / flipV (toggle), crop [left, bottom, right, top] as fractions trimmed, image (a file that replaces the picture). Undoable.

Kit
PDF 0.1.0 (.pdf)
Changes the document
yes

Parameters

Parameters of content.set
NameTypeRequiredDescription
align"left" | "center" | "right" | "justify"no
boldbooleanno
colorstringno
cropnumber[]no(maxItems 4, minItems 4)
flipHbooleanno
flipVbooleanno
font"helvetica" | "times" | "courier"no
indexintegeryes(minimum 1)
italicbooleanno
pageintegeryes(minimum 1)
rectnumber[]no(maxItems 4, minItems 4)
rotateintegerno
sizenumberno(maximum 500, minimum 1)
textstringno

Call through pdf_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: align, bold, color, crop, flipH, flipV, font, italic, rect, rotate, size, text. 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": {
    "align": {
      "enum": [
        "left",
        "center",
        "right",
        "justify"
      ],
      "type": "string"
    },
    "bold": {
      "type": "boolean"
    },
    "color": {
      "type": "string"
    },
    "crop": {
      "description": "(maxItems 4, minItems 4)",
      "items": {
        "description": "(maximum 0.49, minimum 0)",
        "type": "number"
      },
      "type": "array"
    },
    "flipH": {
      "type": "boolean"
    },
    "flipV": {
      "type": "boolean"
    },
    "font": {
      "enum": [
        "helvetica",
        "times",
        "courier"
      ],
      "type": "string"
    },
    "index": {
      "description": "(minimum 1)",
      "type": "integer"
    },
    "italic": {
      "type": "boolean"
    },
    "page": {
      "description": "(minimum 1)",
      "type": "integer"
    },
    "rect": {
      "description": "(maxItems 4, minItems 4)",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "rotate": {
      "type": "integer"
    },
    "size": {
      "description": "(maximum 500, minimum 1)",
      "type": "number"
    },
    "text": {
      "type": "string"
    }
  },
  "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.