Thanks for reporting.
Maybe… Are you tring to load a remote pdf document?
If you want to display remotely-hosted pdf document,
the following configuration values are necessary.
Access-Control-Allow-Origin "*"
Access-Control-Allow-Headers "range"
Access-Control-Expose-Headers "content-range, content-length, accept-ranges"
Access-Control-Allow-Methods "GET"
For example, write the following setup at .htaccess file on
the remote host (referenced pdf documents were saved).
Header append Access-Control-Allow-Origin "*"
Header append Access-Control-Allow-Headers "range"
Header append Access-Control-Expose-Headers "content-range, content-length, accept-ranges"
Header append Access-Control-Allow-Methods "GET"
Best regards,
References
* Content-Length header exposed in CORS configuration for remote docs breaks PDF viewer #4530 https://github.com/mozilla/pdf.js/issues/4530
* Can I load a PDF from another server (cross domain request)? https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-xhr