2022.2 Migration Guide

PSPDFKit for Web 2022.2 introduces some new APIs and includes several bug fixes. We recommend verifying your implementation to check if it needs updating.

Rotated Document

This release fixes an issue with text rotation.

When text was found on a rotated page, the text was assumed to follow the page rotation, and therefore selected text would be rotated with the page. However, it turned out that the majority of the time, even though the page had been rotated, the text itself followed the usual flow of the page — in most cases, top to bottom. As a result, text selection was compromised and difficult.

From this release on, text is assumed to always be laid out from top to bottom, regardless of the page rotation. If your implementation relies on the former behavior, we suggest you use the UI layout buttons to rotate the document view, which can be programmatically set by modifying the current viewState:

// Rotate document view to 90 degrees.
instance.setViewState((viewState) =>
  viewState.set("pagesRotation", 90)
);

Ink Signature Resizing

This release improves the ink signature UI resizing by keeping its aspect ratio when resized with any resize handler.

It’ll no longer be possible to modify the aspect ratio of an ink annotation when resized with the UI if its isSignature property is set to true, which is the default for signatures created with the Electronic Signatures dialog.

If you want to allow the users to modify the aspect ratio of those ink annotations when they resize them, you can enable this by setting the ink annotation’s isSignature property to false. Once resized, you can restore the flag to true if needed.

Form Filling Permissions

This release fixes an issue where form field value editing with the UI was incorrectly disabled for certain document permissions.

This change fixed a bug where forms were incorrectly set to “read only” for certain document permission combinations:

  • When the “modification” permission wasn’t set (should still be fillable if either “fill forms” or “annotations and forms” permissions were set).

  • When the “fill forms” permission was set, and the “modification” and “annotations and forms” permissions weren’t set.

If your implementation relies on the former behavior, you can emulate it by explicitly setting the form field’s readOnly property to true if your license allows form editing. Or, you can disallow editing its value using the isEditableAnnotation() configuration callback.

Starting with this release, PSPDFKit.Instance#print now accepts an options object as an argument instead of a string.

Before:

instance.print(PSPDFKit.PrintMode.EXPORT_PDF);

Now:

instance.print({
  mode: PSPDFKit.PrintMode.EXPORT_PDF
});

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

Migrate PSPDFKit Server

For more information, please take a look at the PSPDFKit Server 2022.2 Migration Guide.