# Watermark Annotation

## Content

A watermark annotation defines graphics that appear on a page at a fixed size and position, regardless of the dimensions of the printed page. Watermarks are commonly used to display labels such as drafts, confidential marks, or other document status indicators.
![Watermark-Annotation.png](https://cdn.mescius.io/document-site-files/images/706ce9b9-7836-44f3-b62b-7d4408387ae3/Watermark-Annotation-20260424.da1d29.png?width=720)
Use the [WatermarkAnnotation ](https://developer.mescius.com/document-solutions/javascript-pdf-api/api/classes/WatermarkAnnotation)class to add watermark 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 inputDocData = await Util.loadFile("CompleteJavaScriptBook.pdf");
const doc = PdfDocument.load(inputDocData);

//Loop over pages, add a watermark to each page:
for (const page of doc.pages)
{
    // Create an instance of WatermarkAnnotation class and set its relevant properties
    const watermark = new WatermarkAnnotation();
    watermark.rect = { x: 72, y: 72, width: page.width - 72 * 2, height: page.height - 72 * 2 };
    watermark.text = "DRAFT";
    watermark.textFormat = new Format({
        font: Font.getPdfFont(StandardPdfFont.CourierBold),
        fontSize: 108,
        foreColor: "#FF000080" // semitransparent RED color
    });
    watermark.page = page;
}
const docData = doc.savePdf();
Util.saveFile("WatermarkAnnotation.pdf", docData);
```