> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chromiumly.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Stamps

> Draw text, an image, or a page of another PDF over pages: watermarks, seals, letterheads.

Three stages draw over pages: `stamp-text`, `stamp-image` and `stamp-pdf`. They always draw **over** the page content. Positions count in points from the **bottom-left corner** of the page, 72 points to the inch, and `rotation` turns the stamp counter-clockwise around `x` and `y`. `opacity` runs from `0` to `1`; unset, or `0`, draws opaque.

To number pages, use a Chromium [footer](https://docs.chromiumly.dev/chromium/options.md#header-and-footer) instead.

## stamp-text

Draws a line of text.

| Option | Type | Default | Description |
| - | - | - | - |
| `text` | `string` | | The text to draw (required) |
| `pages` | pages | `all` | The pages to stamp |
| `x`, `y` | `number` | `0` | The position, in points from the left and bottom edges |
| `fontSize` | `number` | `12` | In points, greater than 0 |
| `font` | `string` | `"Helvetica"` | One of the 14 standard PDF fonts: `Helvetica`, `Times-Roman`, `Courier`, their `-Bold`, `-Oblique`/`-Italic` variants, `Symbol`, `ZapfDingbats` |
| `color` | `string` | `"#000000"` | `#rrggbb` |
| `opacity` | `number` | | From 0 to 1 |
| `rotation` | `number` | `0` | Degrees, counter-clockwise |

```typescript theme={null}
import { PDF } from "chromiumly";

const watermarked = await PDF.stampText({
  files: ["path/to/report.pdf"],
  text: "CONFIDENTIAL",
  x: 150,
  y: 400,
  fontSize: 48,
  font: "Helvetica-Bold",
  color: "#ff0000",
  opacity: 0.25,
  rotation: 45,
});
```

## stamp-image

Draws a PNG or JPEG image.

| Option | Type | Description |
| - | - | - |
| `image` | [`StageFile`](https://docs.chromiumly.dev/stages#files-a-stage-needs) | The `.png`, `.jpg` or `.jpeg` image (required) |
| `pages` | pages | The pages to stamp (default `all`) |
| `x`, `y` | `number` | The bottom-left corner of the image, in points (default `0`) |
| `width`, `height` | `number` | In points. Set one to keep the proportions; neither draws each pixel as a point |
| `opacity`, `rotation` | `number` | As above |

```typescript theme={null}
const sealed = await PDF.stampImage({
  files: ["path/to/report.pdf"],
  image: "path/to/seal.png",
  x: 450,
  y: 40,
  width: 100,
  pages: "last",
});
```

## stamp-pdf

Draws a page of another PDF: a letterhead, a seal.

| Option | Type | Description |
| - | - | - |
| `source` | [`StageFile`](https://docs.chromiumly.dev/stages#files-a-stage-needs) | The PDF to draw (required) |
| `sourcePage` | `number` | The page of `source` to draw (default `1`) |
| `pages` | pages | The pages to stamp (default `all`) |
| `x`, `y` | `number` | The bottom-left corner, in points (default `0`) |
| `scale` | `number` | Greater than 0 (default `1`) |
| `opacity`, `rotation` | `number` | As above |

```typescript theme={null}
import { HtmlConverter } from "chromiumly";

const letter = await new HtmlConverter().convert({
  html: "path/to/letter.html",
  stages: [{ op: "stamp-pdf", source: "path/to/letterhead.pdf", pages: "1" }],
});
```

Stamps append to the file, so they keep existing signatures.

See [Reference — stages](https://docs.chromiumly.dev/reference/stages.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.