Renato Tavares
Renato Tavares

Reputation: 21

PDF.js not working on IE 11

I've been looking for days now and I am still unable to get PDF.js working on IE11, regardless of IE11 is listed as a supported browser, as showed in PDF.js DEMO.

No errors are shown in Chrome's Console. However, there are 3 errors in IE11's Console:

Chrome's Console

IE10's Console

Could anyone provide some help? Thanks

Upvotes: 2

Views: 5770

Answers (2)

Shubham Yadav
Shubham Yadav

Reputation: 341

IE11 doesn't support ES6 format, so some features of PDF.js won't work in IE11.

You could try to use the ES5 version of pdf.js and pdf.worker.js.

Either :

  1. point import "pdfjs-dist/build/pdf.js" to import "pdfjs-dist/es5/build/pdf.js"
  2. point import "pdfjs-dist/build/pdf.worker.js" to => import "pdfjs- dist/es5/build/pdf.worker.js"

OR use ES5 version:

  1. pdf.js : https://mozilla.github.io/pdf.js/es5/build/pdf.js
  2. pdf.worker.js: https://mozilla.github.io/pdf.js/es5/build/pdf.worker.js

Upvotes: 1

Amir Naeem
Amir Naeem

Reputation: 610

Maybe it's because IE11 doesn't support ES6. Support for ES6 in Internet Explorer 11

I hope this will help someone in the future.

Upvotes: 0

Related Questions