# tools.stamp

Part of [Tools](https://kernstra.com/docs/web-sdk/config/tools) in the Kernstra Web SDK 1.0.0 configuration reference.

- Type: `boolean | StampConfig`
- Default: `on, within the mode`
- Page: https://kernstra.com/docs/web-sdk/config/tools/stamp

Stamp tool. Needs the `annotations` license feature. Takes a `StampConfig` object (or `true`, the same as `{}`). With `builtIn` and `builder` off and neither `custom` nor a valid preset there is nothing to place, and the Stamp tool is hidden.

A picture stamp is kept as a PNG `data:` URL, and one lifted from a page is part of that document — so whatever stores the list holds a copy of it. A region is lifted with at most two megapixels (a seal-sized one at 432 dpi): a lift of a whole scanned page can take a few megabytes, past what `localStorage` holds in some browsers. Size the store for it, and keep the list for the session only where documents are confidential. A kept stamp larger than a PDF page (14,400 points a side) or a wording longer than 32 characters is skipped when restored.

```ts
// Your own wording stamps instead of the English set
tools: {
  stamp: {
    builtIn: false,
    presets: [
      { label: 'GENEHMIGT', color: '#2E7D32' },
      { label: 'EINGANG', color: '#C62828', dated: true, border: 'ribbon' },
    ],
  },
}
```

### `stamp.builtIn`

- Type: `boolean`
- Default: `true`
- Page: https://kernstra.com/docs/web-sdk/config/tools/stamp-builtin

Show the tick, cross and dot, the standard set and RECEIVED with today's date. With `builtIn: false`, `presets` are listed alone.

### `stamp.builder`

- Type: `boolean`
- Default: `true`
- Page: https://kernstra.com/docs/web-sdk/config/tools/stamp-builder

"New stamp" and the stamps made with it. `builder: false` takes "New stamp" and the stamps made with it off the picker.

### `stamp.custom`

- Type: `{ label: string; url: string }[]`
- Page: https://kernstra.com/docs/web-sdk/config/tools/stamp-custom

Your own stamp images, listed under **Yours** next to the stamps the user makes, at their own proportions and at most 200 pt wide. A `data:` URL whose header claims a raster too large to decode (over 64 million pixels, or a side over 16384 px) is left out with a console warning. A stamp image `url` on another origin needs that origin in `connect-src` or `img-src`.

```ts
tools: { stamp: { builtIn: true, custom: [{ label: 'Logo', url: '/stamps/logo.png' }] } }
```

### `stamp.presets`

- Type: `readonly StampPreset[]`
- Page: https://kernstra.com/docs/web-sdk/config/tools/stamp-presets

Your own wording stamps, listed with the standard set — the words are written into the document exactly as you give them, so give them in your users' language — after the standard set (a `dated` one under "With today's date"), or alone with `builtIn: false`. They cannot be removed from the picker. A `StampPreset` is `{ label, color?, dated?, border? }`: `label` the wording (e.g. `'PAID'`, `'BEZAHLT'`), `color` a hex ink (default: the first of `inks`), `dated` adds the placing date under the wording (default `false`), `border` is `'boxed'` (default), `'ribbon'` or `'plain'`. A `label` is trimmed; one left empty is skipped with a console warning, as is one whose `color` is not a hex color (only a preset with no `color` at all takes the first ink). `#rgb` is expanded to `#RRGGBB`.

### `stamp.inks`

- Type: `ColorList`
- Default: `red, blue, green, black`
- Page: https://kernstra.com/docs/web-sdk/config/tools/stamp-inks

The inks "New stamp" offers. A `ColorList` is a list of hex strings or color options (see [Annotations](https://kernstra.com/docs/web-sdk/config/annotations)).

### `stamp.userStamps`

- Type: `readonly SavedStamp[]`
- Page: https://kernstra.com/docs/web-sdk/config/tools/stamp-userstamps

Stamps the user made before, to restore. Stamps made with "New stamp" last for the session; to keep them, store what the [`userStampsChanged`](https://kernstra.com/docs/web-sdk/api/events#ev-userstampschanged) event gives you and pass it back here. At most eight are kept, shared by every viewer on the page. See [What you can replace](https://kernstra.com/docs/web-sdk/guides/replace).

Web page: https://kernstra.com/docs/web-sdk/config/tools/stamp
