PDF.js CORS issue
Finally found the problem. My server was not passing the Access-Control-Allow-Credentials: true
header to the response, which was needed (xhr request was sent with xhr.withCredential
).
CORS is now working properly.
Found the solution at: https://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/
I get a Cross-Origin Request blocked when trying to use pdf.js
The problem is you can't read file from local system directly due to security issues. You need to run a simple web server to load pdf file form. This option you mentioned should be set on webserver side not your side. Try running simple static webserver available with npm,...
You can also use FileReader
api to read files on system.
Related Topics
How to Style Dynamically Created Elements With CSS
How to Convert a Htmlelement to a String
Multi Select Drop Down With Checkbox
Is It Okay to Call Onclick on an Anchor Tag in Reactjs
How to Translate the Following Jquery Code to React
Bootstrap Datepicker Appearing At Incorrect Location in a Modal
How to Validate for Only CSV File Uploads Using the Pattern Attribute Using Html5
Progressive Web App - Service Worker Not Serving Start_Url
How to Capture the Browser Window Close Event
Easiest Way to Mask Characters in Html(5) Text Input
How to Add Counter in Angular 6
Generate a Weighted Random Number
Get the Value of Datepicker on Change in Jquery
How to Separate an Integer into Separate Digits in an Array in JavaScript
How to Align Text Input Correctly in React Native
How to Loop Over Object Properties With Ngfor in Angular
How to Use Fetch Within a For-Loop, Wait for Results and Then Console.Log It