PDF kit command
file.setWatermark
Add watermark
Add a watermark to pages: text, or a picture from `file` (an image, or page `filePage` of a PDF) at `scale` of the page (default 0.5); rotated (degrees counter-clockwise, default 45), semi-transparent (opacity 0–1, default 0.5), text fitted to the page unless fontSize is given, on top unless behind: true. replace: true swaps out existing ones. Undoable.
- Kit
- PDF 0.1.0 (.pdf)
- Changes the document
- yes
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
behind | boolean | no | |
color | string | no | |
filePage | integer | no | (minimum 1) |
fontSize | number | no | |
opacity | number | no | (maximum 1, minimum 0) |
pages | integer[] | no | 1-based page numbers to mark (default: all). (minItems 1) |
replace | boolean | no | |
rotation | number | no | |
scale | number | no | (maximum 1) |
text | string | no | (minLength 1) |
Call through pdf_run
pdf_run {
"path": "<file>.pdf",
"steps": [{ "command": "file.setWatermark" }]
}The required parameters, with placeholders for their types: not a tested example. Optional: behind, color, filePage, fontSize, opacity, pages, replace, rotation, scale, text. 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": {
"behind": {
"type": "boolean"
},
"color": {
"type": "string"
},
"filePage": {
"description": "(minimum 1)",
"type": "integer"
},
"fontSize": {
"type": "number"
},
"opacity": {
"description": "(maximum 1, minimum 0)",
"type": "number"
},
"pages": {
"description": "1-based page numbers to mark (default: all). (minItems 1)",
"items": {
"description": "(minimum 1)",
"type": "integer"
},
"type": "array"
},
"replace": {
"type": "boolean"
},
"rotation": {
"type": "number"
},
"scale": {
"description": "(maximum 1)",
"type": "number"
},
"text": {
"description": "(minLength 1)",
"type": "string"
}
},
"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.