# Watermark doesn't disappear although I added the licence key

**URL:** https://pdfjs.community/t/watermark-doesnt-disappear-although-i-added-the-licence-key/2528
**Category:** Technical Support
**Created:** [April 19, 2023, 9:01am UTC](https://pdfjs.community/t/watermark-doesnt-disappear-although-i-added-the-licence-key/2528 "2023-04-19T09:01:52Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ludwig.pfefferkorn](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@ludwig.pfefferkorn](https://pdfjs.community/u/ludwig.pfefferkorn)
#### Post date: [April 19, 2023, 9:01am UTC](https://pdfjs.community/t/watermark-doesnt-disappear-although-i-added-the-licence-key/2528/1 "2023-04-19T09:01:52Z")

</div>

**PDF.js Express Viewer**

**UI Version 8.7.0  
Core 8.7.2  
webviewer.min.js 8.7.2**

**Watermark doesn’t disappear although I added the licence key**

**… but it should disappear**

**… and it happens with every document under localhost and under my registered domain: schuldenonline.at  
Cache is deleted.**

\*\* WebViewer({  
path: ‘/pdfjs/lib’, // path to the PDF.js Express’lib’ folder on your server  
licenseKey: ‘SZJ5A4Quf47qW1mAlDRj’,  
initialDoc: ‘/dropzone/sendfile?dokid=3557042&fromdz=dropzoneablage’,  
}, document.getElementById(‘viewer’))  
.then(instance =\> {  
// now you can access APIs through the WebViewer instance  
const { Core, UI } = instance;

```
// adding an event listener for when a document is loaded
Core.documentViewer.addEventListener('documentLoaded', () => {
  console.log('document loaded');
});

// adding an event listener for when the page number has changed
Core.documentViewer.addEventListener('pageNumberUpdated', (pageNumber) => {
  console.log(`Page number is: ${pageNumber}`);
});

instance.UI.setHeaderItems(function(header) {
  var myCustomButton = {
    type: 'actionButton',
    img: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"/></svg>',
    onClick: function() {
		const xfdfString = instance.Core.annotationManager.exportAnnotations();
		saveToDatabase(3554923, xfdfString)
    }
  }

  header.push(myCustomButton);
});

```

});\*\*

Thank you for your support!

---

<div class="post-metadata">

### Author: ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)
#### Post date: [April 19, 2023, 3:58pm UTC](https://pdfjs.community/t/watermark-doesnt-disappear-although-i-added-the-licence-key/2528/3 "2023-04-19T15:58:11Z")

</div>

Hi there,

Thank you for contacting pdf.js express forums,

Please note that in development mode (i.e. localhost) the watermark will always show up.

One common reason this happens is when you have different pdf.js packages (i.e. having both viewer and pro versions when you should only use one)

> [@Watermarks will not go away when deployed to server](https://pdfjs.community/t/watermarks-will-not-go-away-when-deployed-to-server/2310):
>
> Which product are you using? PDF.js Express Viewer PDF.js Express Version 8.7 Detailed description of issue When using the viewer in React and hosting the viewer static through Apache in the root directory, the watermarks will not go away. I also tried to host it through a Nodejs Express deployment and that didnt work either. I verified that Im getting a 200 response on the call to [auth.pdfjs.express](http://auth.pdfjs.express), @pdftron/pdfjs-express-viewer is being used and the key being used is definitely setup on…

> [@Watermark issue](https://pdfjs.community/t/watermark-issue/1586):
>
> Which product are you using? PDF.js Express Viewer PDF.js Express Version |UI version|‘8.3.2’| |Core version|‘8.3.0’| |Build|‘My8xNi8yMDIyfDJiMGM2Y2IyZA==’| |WebViewer Server|false| |Full API|false| Detailed description of issue Even though I entered the [PdfJs.Express](http://PdfJs.Express) license key, the watermark in the docs still remains. What do I have to do to get the Watermaks remove? Expected behaviour {Provide a screenshot or description of the expected behaviour} Does your issue happen with ever…

When loading the viewer under your domain, could you provide any console error messages if any? Here’s another forum post where it was solved via unblocking csp headers:

> [@Watermark not disappearing despite valid license](https://pdfjs.community/t/watermark-not-disappearing-despite-valid-license/1612):
>
> Which product are you using? PDF.js Express Viewer PDF.js Express Version 8.4.0 Detailed description of issue Even though I have entered the correct key, the watermark is still displayed when running on the server. It’s an angular application. I tried using @pdftron/pdfjs-express as well as @pdftron/pdfjs-express-viewer. In both cases, the watermark never disappears. However, there are some differences. @pdftron/pdfjs-express: locally: PDF is displayed, watermark is displayed, no consol…

Best regards,  
Kevin Kim
