1 release notes

We’re pleased to announce Nutrient Web SDK 1, formerly known as PSPDFKit for Web. Alongside our rebranding, we adopted a new versioning scheme: (<major>.<minor>.<patch>). This release resets our version number to 1.0.0.

The legacy pspdfkit NPM package is now deprecated. Switch to the new @nutrient-sdk/viewer package by updating your application’s package.json file:

npm uninstall pspdfkit
npm install @nutrient-sdk/viewer

Beyond the renaming, 1.0.0 ships with numerous fixes, performance enhancements, and UI improvements. Refer to the changelog for full details.

Below, we highlight important changes you may need to address when upgrading, including several API updates and deprecations.

Breaking API changes

The PSPDFKit.ViewState#enableAlwaysScrollToZoom property is deprecated in favor of the more flexible ViewState.zoom API. This improves zoom behavior control and aligns with our modern API design.

Current behavior

Existing implementations using enableAlwaysScrollToZoom will continue to work in 1.0.0 but will log warnings in the console.

Future behavior

In 2.0.0, enableAlwaysScrollToZoom will be removed entirely. Any code referencing it must be updated to use the new zoom API.

Before:

instance.setViewState((viewState) =>
  viewState.set("enableAlwaysScrollToZoom", true)
);

After:

instance.setViewState(viewState =>
  viewState.set(
    'zoom', {
      // Configure scroll wheel zoom behavior.
      wheelZoomMode: PSPDFKit.WheelZoomMode.ALWAYS
      // ... other zoom options.
    }
  )
);

Toolbars UI migration

Annotation toolbars have undergone a significant overhaul to improve accessibility and customization capabilities, leveraging our in-house Baseline UI design system. These changes bring them in line with the updated look of other UI components, such as the sidebar and main toolbar, while also enhancing support for users’ accessibility requirements.

Text Comparison API changes

Several updates have been made to the Text Comparison API to ensure consistency with documentation and to unify data handling.

  1. TextBlock.rects renamed to TextBlock.rect

Previous behavior: TextBlock.rects was documented, but no rects were returned. Impact: Use TextBlock.rect instead of TextBlock.rects.

  1. TextBlock.rect coordinates format updated

Previous behavior: Coordinates were returned using a PDF coordinate system. Impact: If your application relied on PDF-style coordinates, update your logic to accommodate the new x, y, width, height format.

  1. Operation.originalTextBlocks and Operation.changedTextBlocks return arrays

Previous behavior: Only one TextBlock object was documented to be returned. Impact: These now return an array of TextBlock objects. Make sure your code handles multiple items.

  1. PageComparisonResult.originalPageIndex and PageComparisonResult.changedPageIndex are optional

Previous behavior: These properties were always present. Impact: Your code should now handle the possibility that these values may be undefined — particularly when comparing documents with differing page counts.

For a complete list of changes, bug fixes, and performance improvements, refer to the changelog. We appreciate your feedback and contributions as we continue to enhance Nutrient Web SDK.