2023.4 Migration Guide
PSPDFKit for Web 2023.4 introduces some new APIs and includes several bug fixes. To determine if you need to take action, check your implementation and refer to the information below.
Notable Changes
The following sections outline notable changes in PSPDFKit for Web 2023.4.
Link Annotation Notes Are No Longer Rendered
Previously, annotation note buttons for link annotations interfered with the interaction with the link. Consequently, the link annotation toolbar button has been removed. However, it’s still possible to programmatically add notes to link annotations by modifying the note
property:
const annotations = await instance.getAnnotations(0); const linkAnnotations = annotations.filter(annotation => annotation instanceof PSPDFKit.Annotations.LinkAnnotation); instance.update(linkAnnotations.map(annotation => annotation.set('note', "This is a note"));
If you need a note to be displayed, we recommend using PSPDFKit.Annotations#NoteAnnotation
instead, placing it near the link annotation:
const annotations = await instance.getAnnotations(0); const linkAnnotations = annotations.filter(annotation => annotation instanceof PSPDFKit.Annotations.LinkAnnotation); const noteAnnotations = linkAnnotations.map(annotation => new PSPDFKit.Annotations.NoteAnnotation({ pageIndex: annotation.pageIndex, boundingBox: annotation.boundingBox.merge({ top: annotation.boundingBox.top - 64, left: annotation.boundingBox.left + (annotation.boundingBox.width / 2) - 16, width: 32, height: 32, })), note: "This is a note", }) ); instance.create(noteAnnotations);
Custom Fonts Are Now Listed in Font Selectors
Custom fonts provided in Standalone mode will now appear listed in font family selectors for text annotations, Form Creator, and Content Editor. They’ll be listed with their actual font names, regardless of the name provided in the configuration.
If you don’t want custom fonts to be listed in the font selectors, you can hide them from the UI using CSS:
.PSPDFKit-Input-Dropdown-Item [name="Custom Font Name"] {
display: none;
}
Migrate PSPDFKit Server
For information on PSPDFKit Server migration, see PSPDFKit Server 2023.4 Migration Guide.
For a full list of changes, check out the changelog.