# License key not working

**URL:** <https://pdfjs.community/t/license-key-not-working/3583>\
**Category:** Technical Support\
**Created:** [January 27, 2025, 10:47am UTC](https://pdfjs.community/t/license-key-not-working/3583 "2025-01-27T10:47:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tania.vanderstraeten](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@tania.vanderstraeten](https://pdfjs.community/u/tania.vanderstraeten)\
**Post date:** [January 27, 2025, 10:47am UTC](https://pdfjs.community/t/license-key-not-working/3583/1 "2025-01-27T10:47:55Z")

</div>

Hello,  
When I run de program locally the license key is accepted: [PDFJS.express](http://PDFJS.express): Development environment detected. This license key is currently registered to adhoc.ilvo  
However when I run it on the server I get: [PDFJS.express](http://PDFJS.express): A valid license key is required to use the view only build of PDF.js Express.  
The url of the application is [https://signit.adhoc.ilvo/](https://signit.adhoc.ilvo/) , it is an intranet application. And I downloaded the correct files: PDFJSExpress-view-only.zip.  
I tried to use loadDocument or initialDoc, both work locally, but not on the server:  
WebViewer({  
path: ‘lib/pdfjsexpress’,  
licenseKey: ‘@ViewBag.LicenseKey’,  
initialDoc: ‘[https://pdftron.s3.amazonaws.com/downloads/pl/webviewer-demo.pdf](https://pdftron.s3.amazonaws.com/downloads/pl/webviewer-demo.pdf)’,  
}, document.getElementById(‘viewer’))  
.then(instance =\> {  
instance.setLayoutMode(instance.LayoutMode.Single);  
const { documentViewer } = instance.Core;  
[//documentViewer.loadDocument](https://documentViewer.loadDocument)(urlFile, { filename: ‘test.pdf’, extension: ‘pdf’ })  
});  
Thank you  
Tania

---

<div class="post-metadata">

**Author:** ![tgordon](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tgordon](https://pdfjs.community/u/tgordon)\
**Post date:** [January 29, 2025, 9:08pm UTC](https://pdfjs.community/t/license-key-not-working/3583/3 "2025-01-29T21:08:04Z")

</div>

Hello tania.vanderstraeten,

Thank you for reaching out! Do you see any errors in the console or network tab? There could be a message there showing why the key did not work.

Alternatively, please double check the value of: ‘@ViewBag.LicenseKey’,  
to ensure its the correct value

Best regards,  
Tyler

---

<div class="post-metadata">

**Author:** ![tania.vanderstraeten](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@tania.vanderstraeten](https://pdfjs.community/u/tania.vanderstraeten)\
**Post date:** [January 30, 2025, 10:51am UTC](https://pdfjs.community/t/license-key-not-working/3583/4 "2025-01-30T10:51:17Z")

</div>

Hello Tyler,

Thank you for your reply.  
The licenseKey in code is correct, it is the key for adhoc.ilvo.  
The request [https://auth.pdfjs.express/?key=CKiK](https://auth.pdfjs.express/?key=CKiK)… returns ok and the request [https://pi.pdfjs.express/events](https://pi.pdfjs.express/events) also returns ok, but then I get the error A valid license key is required.  
Does the domain name need to be registered? This is not the case with adhoc.ilvo.  
Kind regards  
Tania

---

<div class="post-metadata">

**Author:** ![tgordon](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tgordon](https://pdfjs.community/u/tgordon)\
**Post date:** [February 3, 2025, 7:01pm UTC](https://pdfjs.community/t/license-key-not-working/3583/5 "2025-02-03T19:01:53Z")

</div>

Hello tania.vanderstraeten,

If adhoc.ilvo is not registered, how are you using the domain?  
If the domain is not pointing to a server, and the license key is pointing to that domain, how would the license key be used?

Best regards,  
Tyler
