PDF kit command
image.edit
Edit an image
Change one of a page's images (number from page.listImages): action move (rect: new box in top-left-origin points), rotate (quarters clockwise, default 1), flip_horizontal, flip_vertical, replace (path: an image file, drawn in the same place) or delete. Undoable. Form artwork supports move/resize/rotate/flip/delete as a group; replace and image_save only support raster images.
- Kit
- PDF 0.1.0 (.pdf)
- Changes the document
- yes
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
action | "move" | "rotate" | "flip_horizontal" | "flip_vertical" | "replace" | "delete" | yes | |
image | integer | yes | (minimum 1) |
page | integer | yes | (minimum 1) |
quarters | integer | no | |
rect | number[] | no | (maxItems 4, minItems 4) |
Call through pdf_run
pdf_run {
"path": "<file>.pdf",
"steps": [{ "command": "image.edit", "params": { "action": <"move" | "rotate" | "flip_horizontal" | "flip_vertical" | "replace" | "delete">, "image": <integer>, "page": <integer> } }]
}The required parameters, with placeholders for their types: not a tested example. Optional: quarters, rect. pdf_run answers the step’s result in completed[i].result.
Result
The kit gives no result schema for this command.
Parameter schema
{
"additionalProperties": false,
"properties": {
"action": {
"enum": [
"move",
"rotate",
"flip_horizontal",
"flip_vertical",
"replace",
"delete"
],
"type": "string"
},
"image": {
"description": "(minimum 1)",
"type": "integer"
},
"page": {
"description": "(minimum 1)",
"type": "integer"
},
"quarters": {
"type": "integer"
},
"rect": {
"description": "(maxItems 4, minItems 4)",
"items": {
"type": "number"
},
"type": "array"
}
},
"required": [
"action",
"image",
"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.