# Watermark api fail to compile with demo haven't purchased a licence key yet

**URL:** https://pdfjs.community/t/watermark-api-fail-to-compile-with-demo-havent-purchased-a-licence-key-yet/471
**Category:** Technical Support
**Created:** [February 3, 2021, 5:56am UTC](https://pdfjs.community/t/watermark-api-fail-to-compile-with-demo-havent-purchased-a-licence-key-yet/471 "2021-02-03T05:56:28Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![shadrach.akao.shipbo](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@shadrach.akao.shipbo](https://pdfjs.community/u/shadrach.akao.shipbo)
#### Post date: [February 3, 2021, 5:56am UTC](https://pdfjs.community/t/watermark-api-fail-to-compile-with-demo-havent-purchased-a-licence-key-yet/471/1 "2021-02-03T05:56:28Z")

</div>

**PDF.js Express Version 6.2.1**

**Detailed description of issue**  
{Fail to add watermark in the document , trying to use the watermark with [ `docViewer.setWatermark`

**Code snippet**  
{WebViewer({  
initialDoc: ‘[https://url/to/my\_file.docx](https://url/to/my_file.docx)’,  
// …  
}, viewerElement)  
.then(instance =\> {  
const { docViewer } = instance;

```
docViewer.setWatermark({
  // Draw diagonal watermark in middle of the document
  diagonal: {
    fontSize: 25, // or even smaller size
    fontFamily: 'sans-serif',
    color: 'red',
    opacity: 50, // from 0 to 100
    text: 'Watermark'
  },

  // Draw header watermark
  header: {
    fontSize: 10,
    fontFamily: 'sans-serif',
    color: 'red',
    opacity: 70,
    left: 'left watermark',
    center: 'center watermark',
    right: ''
  }
});

```

});}

---

_[View the full topic](https://pdfjs.community/t/watermark-api-fail-to-compile-with-demo-havent-purchased-a-licence-key-yet/471)._
