Localhost domain (with subdomain and port) not reconised

Which product are you using?
PDF.js Express Viewer

PDF.js Express Version
8.7.0

Detailed description of issue
License key doesn’t work with http://sub.domain.localhost:3000.

Error message on console:

PDFJSDocumentType.js:125 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
License key should work for every “localhost” domain and subdomains

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

import WebViewer from "@pdftron/pdfjs-express-viewer"

WebViewer({
  path: '/pdfjsexpress/',
  licenseKey: 'tAuGf68iUvaw4V9b3MMv',
  initialDoc: 'https://pdftron.s3.amazonaws.com/downloads/pl/webviewer-demo.pdf',
}, document.getElementById("pdf-viewer"));

Hi there,

Thank you for contacting pdf.js express forums,

Can you confirm you have the correct package installed? PDF.js express and PDF.js express Viewer are separate products with different license keys. Please make sure you are using the right product for your license key.

If you still have issues, please try without the port as explained by this forum post:

Best regards,
Kevin Kim


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here