> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/web/annotation/stamps.md).

# Create Custom PDF Stamps Using JavaScript

Learn how to create and customize standard and custom stamps in WebViewer. Control the appearance of stamps with APIs. Explore demo options for stamps and annotations. The Apryse Web SDK streamlines s

By default WebViewer includes several standard stamps that are part of the PDF specification, but it also supports the creation of custom stamps with custom text and colors. You can control the standard and custom stamps that show up by default in the UI by using the APIs described below. [Launch demo for stamps](https://showcase.apryse.com/pdf-stamps) or [demo custom annotations](https://showcase.apryse.com/custom-annotations).

## Standard stamps

To get a list of the standard stamps you can call [getDefaultStamps](https://sdk.apryse.com/api/web/Core.Tools.RubberStampCreateTool.html#getDefaultStamps__anchor) and to update the list you can call [setStandardStamps](https://sdk.apryse.com/api/web/Core.Tools.RubberStampCreateTool.html#setStandardStamps__anchor). Stamps in this list will show up in the UI under the standard tab.

Default standard stamps:

* Approved
* AsIs
* Completed
* Confidential
* Departmental
* Draft
* Experimental
* Expired
* Final
* ForComment
* ForPublicRelease
* InformationOnly
* NotApproved
* NotForPublicRelease
* PreliminaryResults
* Sold
* TopSecret
* Void
* SHSignHere
* SHWitness
* SHInitialHere
* SHAccepted
* SBRejected

For example you can add an image URL to the list so that it shows up in the standard list:

{% tabs %}
{% tab title="JavaScript (SDK v8.0+)" %}
{% code lineNumbers="true" %}

```js
Webviewer({...}, wvElement).then(instance => {
  const { documentViewer } = instance.Core;

  // This relative path will most likely be different (replace image). Don't expect this to work for you.
  const pathToLogo = '/envs/image.png';
  const tool = documentViewer.getTool('AnnotationCreateRubberStamp');

  tool.setStandardStamps([
    'Approved',
    'AsIs',
    pathToLogo,
  ]);
})
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript (SDK v7.0+)" %}
{% code lineNumbers="true" %}

```js
Webviewer({...}, wvElement).then(instance => {
  const { docViewer } = instance;

  // This relative path will most likely be different (replace image). Don't expect this to work for you.
  const pathToLogo = '/envs/image.png';  
  const tool = docViewer.getTool('AnnotationCreateRubberStamp');

  tool.setStandardStamps([
    'Approved',
    'AsIs',
    pathToLogo,
  ]);
})
```

{% endcode %}
{% endtab %}
{% endtabs %}

![](https://3532544125-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX9YnTSKIHvV7m0A36LbO%2Fuploads%2Fgit-blob-e2062d188decfa8925c4559863ef73be77c56480%2F361cccf2223f501e41b522c5d475bc1ab2d937d6-460x366.png?alt=media)

## Custom stamps

WebViewer also supports adding custom stamps with a custom label, timestamp text and color. To create custom stamps, pass an array of stamp objects to the [setCustomStamps](https://sdk.apryse.com/api/web/Core.Tools.RubberStampCreateTool.html#setCustomStamps__anchor) method of AnnotationCreateRubberStamp tool.

{% tabs %}
{% tab title="JavaScript (SDK v8.0+)" %}
{% code lineNumbers="true" %}

```js
Webviewer({...}, wvElement).then(instance => {
  const { documentViewer, Annotations } = instance.Core;

  const tool = documentViewer.getTool('AnnotationCreateRubberStamp');

  const customStamps = [
    { title: "Approved", subtitle: "[By $currentUser at] h:mm:ss a, MMMM D, YYYY" },
    { title: "Reviewed", subtitle: "[By $currentUser at] h:mm:ss a, MMMM D, YYYY", color: new Annotations.Color('#D65656') },
  ]
  tool.setCustomStamps(customStamps)
})
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript (SDK v7.0+)" %}
{% code lineNumbers="true" %}

```js
Webviewer({...}, wvElement).then(instance => {
  const { docViewer, Annotations } = instance;

  const tool = docViewer.getTool('AnnotationCreateRubberStamp');

  const customStamps = [
    { title: "Approved", subtitle: "[By $currentUser at] h:mm:ss a, MMMM D, YYYY" },
    { title: "Reviewed", subtitle: "[By $currentUser at] h:mm:ss a, MMMM D, YYYY", color: new Annotations.Color('#D65656') },
  ]
  tool.setCustomStamps(customStamps)
})
```

{% endcode %}
{% endtab %}
{% endtabs %}

These custom stamps will show up by default in the UI under the custom tab:

![](https://3532544125-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX9YnTSKIHvV7m0A36LbO%2Fuploads%2Fgit-blob-7810e7469513b28e9444d6cbdca580dc192e6ece%2F70cae62eb1adb2c6e190bafac61f495c75e41b02-460x444.png?alt=media)

Custom stamps can also manually be created by users from this UI tab.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/web/annotation/stamps.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
