Pdfjs express viewer not loading the document - Invalid key

Which product are you using?

@pdftron/pdfjs-express-viewer

PDF.js Express Version

UI version: 8.4.1
Core version: 8.4.0
Detailed description of issue
I am upgrading my app that uses pdfjs-express version 6 (UI 6.2.0, Core 6.2.1) to pdfjs-express-viewer version 8, I am using the same license key that works on the previous code but I am getting below error when trying to view the document:

Error: PDFJS.express: A valid license key is required to use the view only build of PDF.js Express. Get your free license key at https://pdfjs.express/profile (account required)

Expected behaviour
{Provide a screenshot or description of the expected behaviour}

Does your issue happen with every document, or just one?
The issue happens on all documents

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

Code snippet

WebViewer({
    path: '{{ url_for('static', filename='js/pdfjs-express-viewer') }}/public', 
    licenseKey: 'zzzzzz,
    initialDoc: '{{ url_for('static', filename='docs') }}/doc2.pdf', 
  }, document.getElementById('viewer'))
  .then(instance => {
});

Hello, I’m Ron, an automated tech support bot :robot:

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

Guides:APIs:Forums:

Hi there, pdfjs-express and pdfjs-express-viewer are different products with different license keys. Please make sure you are using the right product for your license key.

Please also check out this post.

If none of that works please reply here and we can investigate further.

Thanks!
Logan

Thank you for your assistance.
I managed to find the issue. I was using 127.0.0.1 to try to view my documents instead of localhost (The keys’s domain was tied to localhost), pdf express viewer seems to make a difference between the 2.

1 Like