Nutrient 8.8 migration guide
This guide provides the necessary steps for migrating from Nutrient Android SDK 8 to Nutrient Android SDK 8.8.
Before updating to Nutrient Android SDK 8.8, make sure your app is running at least Nutrient Android SDK 8. If you’re running an earlier version, see our previous migration guides first, which will guide you through the necessary update steps up to version 8.8.
Upgrading Nutrient
Inside your app/build.gradle
file, update the version of the com.pspdfkit:pspdfkit
dependency to 8.8.0
:
dependencies { - implementation 'com.pspdfkit:pspdfkit:8.7.0' + implementation 'com.pspdfkit:pspdfkit:8.8.0' }
Upgrading OCR dependencies
If your project also integrates the [Nutrient OCR library][], make sure to upgrade the version of all OCR dependencies too:
dependencies { - implementation 'com.pspdfkit:pspdfkit-ocr:8.7.0' - implementation 'com.pspdfkit:pspdfkit-ocr-english:8.7.0' + implementation 'com.pspdfkit:pspdfkit-ocr:8.8.0' + implementation 'com.pspdfkit:pspdfkit-ocr-english:8.8.0' ... }
API changes
Nutrient Android SDK 8.8 introduces a new version of the measurement tools introduced in version 8.4! There are a few breaking API changes that this version brings, so if you’re using any of the measurement tool APIs, read carefully.
-
FloatPrecision
has changed toMeasurementPrecision
. This is a breaking change if you were previously usingFloatPrecision
. -
Scale and precision have been combined into one class,
MeasurementValueConfiguration
. -
Multiple
MeasurementValueConfiguration
s can be stored and selected via the UI or API usingMeasurementValueConfigurationEditor
.-
To add/remove precision and scale, you can now use:
-
To get all the configurations, you can now use:
-
-
New snapping options — snap to point, snap to self, and snapping to smart guides — can be found in
PSPDFKitPreferences
and turned off/on via this API.
Other API changes
The API to customize the minimum annotation size for specific annotation types has changed. If you use this API, you’ll need to change your code for this version to work. (#39922)
Old: PdfConfiguration.Builder#setMinimumAnnotationSize(AnnotationType, Size)
New: Annotation#setMinimumAnnotationSizeForType(AnnotationType, Size)
Deprecations
-
PdfDocument#isValidForEditing
has been deprecated in favor ofPdfDocument#isWritableAndCanSave
. (#40058) -
PdfDocument#setMeasurementScale
is deprecated. For more information, see above. -
PdfDocument#getMeasurementScale
is deprecated. For more information, see above. -
PdfDocument#setMeasurementPrecision
is deprecated. For more information, see above. -
PdfDocument#getMeasurementPrecision
is deprecated. For more information, see above. -
Scale#defaultScale
has been deprecated in favor ofMeasurementValueConfiguration#defaultConfiguration().getScale()
.