2021.1 Migration Guide

PSPDFKit for Web 2021.1 comes with a few improvements that might require an ad hoc migration.

Notable Changes

  • (#25320) This release removes the PSPDFKit.Configuration#disableIndexedDBCaching option. The reason for this is browsers dropped plans to ship this caching strategy, and instead, the caching of WebAssembly modules will follow regular HTTP cache rules.

    Now, there’s no longer a way to enable IndexedDB caching, so disableIndexedDBCaching isn’t necessary and doesn’t have any effect.

    This flag will be entirely removed in a future release of PSPDFKit for Web, so it’s recommended to remove it from the PSPDFKit.Configuration object when creating a PSPDFKit instance.

    For more information about WebAssembly modules caching, please refer to the MDN page, this Mozilla bug entry, and this WebAssembly spec issue.

  • (#26594) This release ships with a new toolbar button, Export PDF. If you don’t want to use it, remove the export-pdf button type from the default toolbar items when loading PSPDFKit:

    const toolbarItems = PSPDFKit.defaultToolbarItems.filter(it => {
      return it.type !== "export-pdf";
    });
    
    PSPDFKit.load({ ...configuration, toolbarItems });
  • (#25309) This release slightly changes the behavior of specifying a range of pages to search within when using the PSPDFKit.Instance#search() API. Previously, specifying both startPageIndex and endPageIndex made search results include matches from the start page index up until the end page index, without including those from the last page. Now, search results also include those from the end page index that’s specified.

To keep the previous behavior, you’ll instead need to call PSPDFKit.Instance#search, passing endPageIndex - 1 as the endPageIndex property value.

  • (#27856) You’ll no longer be allowed to change the rootId of a comment once it has been created. If you were updating the rootId before, make sure you create a new comment instead.

  • (#27443) This release prevents setting PSPDFKit.ViewState#interactionMode to a value that enables annotation creation with the UI when in read-only mode (PSPDFKit.ViewState#readOnly is true). The new interaction mode set via Instance#setViewState is set as null in this case, and a warning is emitted to the console.

If you use PSPDFKit Server, please make sure you read the 2021.1 Server Migration Guide.

For a full list of changes, check out the changelog.