2019.3 Migration Guide
PSPDFKit for Web 2019.3 comes with a few improvements that might require an ad hoc migration.
Notable Changes
-
The default minimum ink and shape annotations sizes,
PSPDFKit.Options.MIN_INK_ANNOTATION_SIZE
andPSPDFKit.Options.MIN_SHAPE_ANNOTATION_SIZE
, have been reduced from128
to16
. The former value was too big for several use cases. If your code relies on the former value, you can set it before the firstPSPDFKit.load()
call:PSPDFKit.Options.MIN_INK_ANNOTATION_SIZE = 128
andPSPDFKit.Options.MIN_SHAPE_ANNOTATION_SIZE = 128
. -
While creating an ink annotation with the UI, new lines may be split into a new annotation if the new line starting point is too distant from the rest of the annotation points, and/or some time has passed since the last point was drawn, especially if the annotation already contains more than a certain amount of lines (over 50).
-
The popover’s HTML structure has changed. Now the arrow element and the popover content are sibling elements. These elements are wrapped with the specific popover class name to enable targeted overrides, e.g.
.PSPDFKit-Popover-Annotation-Tooltip .PSPDFKit-Popover {}
and.PSPDFKit-Popover-Annotation-Tooltip .PSPDFKit-Popover-Arrow {}
. -
In Server mode, the minimum search query length is now configurable on the server with the environment variable
MIN_SEARCH_QUERY_LENGTH
(default:3
). This value is passed to the client at load time, and the client will use it to check against the length of the term provided toPSPDFKit.Instance#search
,PSPDFKit.Instance#startUISearch
, or the UI search form. If the query toPSPDFKit.Instance#search
is shorter than this value, the search request will throw an error. To prevent this, it’s recommended to check the minimum query length value fromPSPDFKit.SearchState#minSearchQueryLength
before performing the search. In the case of the UI search form orPSPDFKit.Instance#startUISearch
, there won’t be an error and the search will just not be performed until the search field value is long enough. In Standalone mode, the default value for this property is1
and it’s not configurable.
If you use PSPDFKit Server, please make sure you read the 2019.3 Server Migration Guide.
For a full list of changes, check out the changelog.