---
title: "file.setWatermark: Add watermark — PDF kit command — Kition"
description: "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."
canonical: "https://developer.kition.ai/docs/kits/pdf/commands/file.setWatermark"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/pdf/commands/file.setWatermark](https://developer.kition.ai/docs/kits/pdf/commands/file.setWatermark)

# 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); reference: [PDF kit commands](https://developer.kition.ai/docs/kits/pdf.md)
- 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

```text
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

```json
{
  "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/pdf-darwin-arm64@0.1.0 and the kit itself (pdf_commands through @kition/cli@0.1.1, built from KitionAI/kition-pdf@b0d2725).
