Which product are you using?
PDF.js Express Viewer
PDF.js Express Version
UI - 8.7.0, Core - 8.7.4
Detailed description of issue
I am locally running an Angular app where my URL is https://acme.app.local. I have a license defined for the domain app.local but in my app I am getting this error message:
I see the request to https://auth.pdfjs.express/?key=vvDl16bko1qkvdFGq6A4&r=1 come back with a 200 and the header Origin is https://acme.app.local.
I saw this ticket Local domain + port; licenseKey not recognised - #21 by zserviss and thought it should work but its not unfortunately.
Code snippet
{Provide a relevant code snippet}
Hello steve.haney,
" I see the request to https://auth.pdfjs.express/?key=vvDl16bko1qkvdFGq6A4&r=1 come back with a 200 and the header Origin is https://acme.app.local."
HTTP Status Code 200 is a correct response, this is not an error.
Can you provide more information? a screenshot of the error?
Best regards,
Tyler
Sure, the error in browser console is the following:
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)
at p.e (PDFJSDocumentType.js:2562:250)
at pdfjsexpress.view-only.wasm:0x2167
at e.value (PDFJSDocumentType.js:2546:117)
at b (PDFJSDocumentType.js:2564:484)
at PDFJSDocumentType.js:2571:251
at L (PDFJSDocumentType.js:2520:340)
at Generator._invoke (PDFJSDocumentType.js:2520:92)
at t$jscomp$0.<computed> [as next] (PDFJSDocumentType.js:2521:25)
at n$jscomp$0 (PDFJSDocumentType.js:2274:389)
at c (PDFJSDocumentType.js:2275:65)
error @ PDFJSDocumentType.js:107
12:52:35.782
This is the response of the call to auth.pdfjs.express. I can’t tell if its expected or not in this format.
{"key":"è½ÅèÜþ»÷úá÷àÛÅþÆÜþìçÅäÈùý"}
Hello steve.haney,
The key looks incorrect, its in a format that is includes the characters: [a-z], [A-Z], [0-9]. Are you modifying the text in some way?
Best regards,
Tyler
Yes, I agree the key returned looks wonky. The key I have in my javascript is the one being passed in the URL https://auth.pdfjs.express/?key=vvDl16bko1qkvdFGq6A4&r=1.
As I said this error is not happening when hosting this on AWS so it seems to be an issue with our local setup using the root URL (https://acme.app.local). At least according to my account license keys that key matches up to the domain app.local.