2022.5 Migration Guide

PSPDFKit for Web 2022.5 introduces some new APIs and includes several bug fixes. To determine if you need to take action, check your implementation and the information below.

Notable Changes

  • (#36401) Internet Explorer 11 is no longer supported in this version. With this change in supported browsers, we’ll be able to focus our efforts on optimizing the Web SDK and adding new functionality by reassigning resources that were needed to keep IE11 support. We’ll also be able to explore how to benefit from modern APIs and features only found in modern browsers.

  • (#36673) PSPDFKit.TextSelection was incorrectly exposed as PSPDFKit.PublicTextSelection. This has been fixed, and PSPDFKit.TextSelection is now the correct type. If your code relied on the incorrect type, change it by renaming any usage of PSPDFKit.PublicTextSelection to PSPDFKit.TextSelection.

  • (#36673) The type for the textSelection.change event listener payload was incorrect and couldn’t be typed as PSPDFKit.TextSelection | null. This is now possible:

import PSPDFKit, { TextSelection } from "pspdfkit";

PSPDFKit.load(baseOptions).then((instance) => {
  instance.addEventListener(
    "textSelection.change",
    function (textSelection: TextSelection | null): void {
      if (textSelection) {
        // `textSelection` is of type `TextSelection`.
      } else {
        // `textSelection` is `null`.
      }
    }
  );
});

Migrate PSPDFKit Server

For more information, see PSPDFKit Server 2022.5 Migration Guide.