# Stamp Annotation

## Content

A stamp annotation displays graphics, images, or text on a page to resemble a stamped mark. When opened, the annotation displays a pop-up window containing the associated note.
![Stamp-Annotation.png](https://cdn.mescius.io/document-site-files/images/706ce9b9-7836-44f3-b62b-7d4408387ae3/Stamp-Annotation-20260424.8dffba.png?width=720)
Use the [StampAnnotation](https://developer.mescius.com/document-solutions/javascript-pdf-api/api/classes/StampAnnotation) class to add stamp annotations to a PDF document.

>type=note
> **Note:** The examples on this page use helper functions from the [Snippet Helpers](https://developer.mescius.com/document-solutions/javascript-pdf-api/docs/snippet-helpers) module. These utilities are provided only to simplify the examples and are not part of the DsPdfJS API.

```javascript
const doc = new PdfDocument();
const page = doc.newPage();

// Create an instance of StampAnnotation class and set its relevant properties
const stamp = new StampAnnotation();
stamp.contents = "This is a sample stamp";
stamp.userName = "Jamie Smith";
stamp.color = "SkyBlue";
stamp.icon = "Confidential";
stamp.creationDate = Date.now();
stamp.rect = { x: 100.5, y: 110.5, width: 72, height: 72 };

page.annotations.add(stamp); //Add the stamp annotation

const docData = doc.savePdf();
Util.saveFile("StampAnnotation.pdf", docData);
```