# Issues with message: "Origin does not match the domain set on license key"

**URL:** <https://pdfjs.community/t/issues-with-message-origin-does-not-match-the-domain-set-on-license-key/917>\
**Category:** Technical Support\
**Created:** [July 30, 2021, 7:53pm UTC](https://pdfjs.community/t/issues-with-message-origin-does-not-match-the-domain-set-on-license-key/917 "2021-07-30T19:53:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![licenses](https://avatars.discourse-cdn.com/v4/letter/l/848f3c/32.png) [@licenses](https://pdfjs.community/u/licenses)\
**Post date:** [July 30, 2021, 7:53pm UTC](https://pdfjs.community/t/issues-with-message-origin-does-not-match-the-domain-set-on-license-key/917/1 "2021-07-30T19:53:47Z")

</div>

**PDF.js Express Version**

**Detailed description of issue**  
I am having issues with a error that keeps up recurring on my production environment. I have followed step three from this documentation [[[Open a document, add annotations, download | Documentation](https://pdfjs.express/documentation/use-case/upload-download)]]. I know that i would probably have to add in my License key, Client Key and Server Key to remove all water marks. When i try and click on this external button it fails out on the merge giveening me the error message below. I have check my domain to make sure that I have set it correctly. Which it is. It seems to be working on the viewer it self just not on the external download.  
Thanks For you help  
**Expected behaviour**  
Right now i am getting this error in my console

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/f15e470611f20fa2494bcb7c470f1977e2f1b844.png)

**Does your issue happen with every document, or just one?**  
Every Document

**Link to document**  
{Provide a link to the document in question if possible}

**Code snippet**  
This is the code snippet that i use to download the PDF externally from the viewer.

```javascript
const pdfUtils = new ExpressUtils({
    serverKey: "Server_Key",
    clientKey: "Client_Key",
});

async function _DownloadContracts() {
        try {
            setVisibilityShowen(true);
            const xfdf = await instance?.annotManager.exportAnnotations({});
            const fileData = await instance?.docViewer.getDocument().getFileData({});

            if (xfdf && fileData) {
                const resp = await pdfUtils.setFile(fileData).setXFDF(xfdf).merge();
                resp.license = "License_Key";
           
                
                const mergedBlob = await resp.getBlob();
                FileSaver.saveAs(mergedBlob, selectedFile.name);
            }
        } catch (e) {
        } finally {
            setVisibilityShowen(false);
        }
    }

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)\
**Post date:** [July 30, 2021, 7:53pm UTC](https://pdfjs.community/t/issues-with-message-origin-does-not-match-the-domain-set-on-license-key/917/2 "2021-07-30T19:53:52Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:
- [PDF.js Express API Errors - Errors](https://pdfjs.express/documentation/utils/errors#errors)
- [Adding your license key](https://pdfjs.express/documentation/get-started/add-license-key)
- [Angular project WebViewer integration issues](https://pdfjs.express/documentation/get-started/angular/angular-integration-issues)

APIs:
- [PDF.js Express Utilities](https://pdfjs.express/api/utils/index.html#__anchor)
- [CoreControls - preloadPDFWorker(pdfBackendType, workerHandlers)](https://pdfjs.express/api/CoreControls.html#.preloadPDFWorker__anchor)
- [Annotations.WidgetAnnotation - setCustomData(key, value)](https://pdfjs.express/api/Annotations.WidgetAnnotation.html#setCustomData__anchor)

Forums:
- [No license key was provided, running in demo mode](https://pdfjs.community/t/no-license-key-was-provided-running-in-demo-mode/902/1)
- [PDF generation Keeps on showing Trail version watermarks even if the Client Api and serverAPI are in place](https://pdfjs.community/t/pdf-generation-keeps-on-showing-trail-version-watermarks-even-if-the-client-api-and-serverapi-are-in-place/914/1)
- [We still receive the pdfjs.express watermark after applying activated key](https://pdfjs.community/t/we-still-receive-the-pdfjs-express-watermark-after-applying-activated-key/161/2)

---

<div class="post-metadata">

**Author:** ![licenses](https://avatars.discourse-cdn.com/v4/letter/l/848f3c/32.png) [@licenses](https://pdfjs.community/u/licenses)\
**Post date:** [August 3, 2021, 5:38pm UTC](https://pdfjs.community/t/issues-with-message-origin-does-not-match-the-domain-set-on-license-key/917/3 "2021-08-03T17:38:40Z")

</div>

I have also hid the resp.license = “License\_Key”; line and still got the error above.

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [August 4, 2021, 3:40pm UTC](https://pdfjs.community/t/issues-with-message-origin-does-not-match-the-domain-set-on-license-key/917/4 "2021-08-04T15:40:34Z")

</div>

Hi,

Can you send me the domain from which you are sending requests from? You can send in a DM if you don’t want to share publically.

Thanks!

---

<div class="post-metadata">

**Author:** ![basilravi](https://avatars.discourse-cdn.com/v4/letter/b/b782af/32.png) [@basilravi](https://pdfjs.community/u/basilravi)\
**Post date:** [September 21, 2022, 4:08am UTC](https://pdfjs.community/t/issues-with-message-origin-does-not-match-the-domain-set-on-license-key/917/5 "2022-09-21T04:08:17Z")

</div>

@Logan Is this issue fixed. I am also getting this same issue.

Thanks  
Ravi
