Nutrient 3.12 migration guide

Nutrient Flutter SDK version 3.12 introduces processing annotation functionality for Android, which was previously only available on iOS. Additionally, this release includes adjustments to the API to improve consistency and ease of use by introducing enum types for the AnnotationProcessingMode and AnnotationType parameters to replace the previous String types.

Parameter changes

The AnnotationProcessingMode and AnnotationType parameters have been updated to enum types, resulting in a more consistent and user-friendly API. The following table illustrates the changes.

Parameter Old type New type
annotationProcessingMode String AnnotationProcessingMode
annotationType String AnnotationType

Example

Here’s an example demonstrating the usage of the new enum types:

// Old way.
await Pspdfkit.processAnnotations('all', 'flatten', documentPath);

// New way.
await Pspdfkit.processAnnotations(AnnotationType.all, AnnotationProcessingMode.flatten, documentPath);

API changes

This release also adds the processAnnotations method to the PspdfkitWidgetController, allowing for annotation processing on a document loaded using the PspdfkitWidget.

Annotation processing on web

The processAnnotations method isn’t available on the web platform. However, you can still achieve the same functionality by using the PdfDocument.exportPdf method with document save options. To learn more about this, check out our guide on exporting PDFs.

For more information, refer to the Nutrient Flutter SDK 3.12 changelog.