Detailed description of issue
The portal won’t allow me to create a key for mysubdomain.localhost, which is what our development environments use. It says that localhost just works, but it doesn’t, and console says I must get a license key.
Expected behaviour
It should work on all subdomains of localhost.
Does your issue happen with every document, or just one?
Every one.
For reference, this is what I see in the console on my domain (https://company.localhost/some-path).
The only two things that might be causing an issue is that I am running on HTTPS, and the PDF I am trying to load is a blob URL (shown as part of an upload process), though there is a related warning for that where it assumes the URL is for a PDF, so perhaps not that.
If I omit the license key, it does not detect that I am running a localhost environment, and insists that I must provide a key.
Are you using the pdf.js express viewer or the pdf.js express package? Note that the free version will need the pdf.js express viewer package. We recommend you to uninstall all traces of the package to make sure there are no conflicts between the 2 packages.
Please could you be more specific? There are a number of methods going on there, none of which look applicable to my use case. We cannot use different ports, and we cannot change to .local. None of these things should matter anyway. We also cannot use IPs.
We use app.subdomain.localhost on port 443. Why can the library not detect that I am running on localhost? And why can I not create a special license key for my localhost subdomain? The way I see it is that either of these processes should be happening, not none of them.
A request to https://auth.pdfjs.express/?key=MYKEY is made, and this comes back with an HTTP 200 OK response containing an encrypted value in the key field of the JSON payload.
After this, the library fetches the PDF data – in my case, it is a blob (before doing this, it does do a HEAD request, which fails because you cannot make such a request for a blob:.
After this, a POST request is made to https://pi.pdfjs.express/events, containing the following:
Have you tried using 127.0.0.1 as an alternative to localhost being the domain?
In addition, the request to https://pi.pdfjs.express/events is gathering tele-metrics, and isn’t used to check the license key.
If the PDF isn’t loading after making the correct request to the auth server, there may be something wrong with the PDF. Are you able to load this in the demo?
Is there any console error messages and any failed network requests?
In addition, there may be some errors in how your keys are setup, please see this forum post for more information:
As noted before, we cannot do this. We have different services running independently of one another, and they need to have a particular domain structure to function and, in the case of the primary frontend, share sessions with other subdomains.
No PDFs are working in my local environment.
No, except for the ones already noted above.
This appears to be related to watermarks, which isn’t my problem at all.
Your own documentation states that it will just work in localhost, but it doesn’t. So I tried to create a key to see if that would work, and it didn’t let me create the key. So I created a key for our production TLD, and that doesn’t work in localhost.
I find it really frustrating that I’m being given the run-around here. The way I see it: I have pointed out that your code is not correctly detecting my localhost environment. Regardless of whether or not there is a license key in the picture, it should just work in localhost environments. What could prevent this from happening?