Internet Explorer 11

PSPDFKit for Web also supports Internet Explorer 11. Since this browser does not support ES2015, here are some caveats for adding full Internet Explorer 11 support.

PSPDFKit for Web Standalone Caveats

The Standalone version of PSPDFKit for Web requires a large amount of memory and can trigger out of memory issues on IE 11, as memory management in that browser is unreliable. Closing/reopening the tab is a workaround; however, if support for IE 11 is important to you, we suggest using the Server-backed version of PSPDFKit for Web.

Don’t Rely on Arrow Functions

Arrow functions are a relatively new addition to the JavaScript language. Please make sure that you don’t use arrow functions in your PSPDFKit integration code without transpiling them to proper ES5.

Consider the following example:

Copy
1
2
3
4
5
6
7
8
9
PSPDFKit.load(configuration)
  .then(instance => {
    instance.setViewState(viewState =>
      viewState.set("currentPageIndex", 1)
    );
  })
  .catch(error => {
    console.error(error.message);
  });

This should be written with non-arrow functions, like this:

Copy
1
2
3
4
5
6
7
8
9
PSPDFKit.load(configuration)
  .then(function(instance) {
    instance.setViewState(function(viewState) {
      return viewState.set("currentPageIndex", 1);
    });
  })
  .catch(function(error) {
    console.error(error.message);
  });

Be aware that single-line arrow functions (without curly braces) do return the value of their expression. This means that it might be necessary to add a return as well (as you can see with the callback of Instance#setViewState in our example above).