AnnotationManagerInterface class abstract

Abstract interface for annotation operations on a PDF document.

Concrete implementations are provided by each platform package:

  • AnnotationManagerAndroid in nutrient_flutter_android
  • AnnotationManagerIOS in nutrient_flutter_ios
  • AnnotationManagerWeb in nutrient_flutter_web

Access via NutrientDocumentInterface.annotations or NutrientController.document.annotations.

Customising Behaviour

Override the annotation manager in your platform adapter:

class MyAndroidAdapter extends AndroidAdapter {
  @override
  AnnotationManagerInterface createAnnotationManager() =>
      MyAnnotationManager(this);
}

class MyAnnotationManager extends AnnotationManagerAndroid {
  @override
  Future<String> getAnnotationsJson(int pageIndex, String type) async {
    // custom logic before delegating
    return super.getAnnotationsJson(pageIndex, type);
  }
}
Available extensions

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addAnnotation(Annotation annotation) Future<Annotation?>

Available on AnnotationManagerInterface, provided by the AnnotationManagerTyped extension

Adds a typed annotation to the document.
addAnnotationJson(String jsonAnnotation, {String? attachment}) Future<String>
Adds an annotation from an Instant JSON string (low-level transport).
exportXfdf({int? pageIndex}) Future<String>
Exports annotations as an XFDF string.
getAnnotationProperties(int pageIndex, String annotationId) Future<AnnotationProperties?>
Returns the typed properties of the annotation at pageIndex with annotationId, or null if not found.
getAnnotations(int pageIndex, [AnnotationType type = AnnotationType.all]) Future<List<Annotation>>

Available on AnnotationManagerInterface, provided by the AnnotationManagerTyped extension

Returns the typed annotations on pageIndex, optionally filtered by type (defaults to all types).
getAnnotationsJson(int pageIndex, String type) Future<String>
Returns a JSON string of all annotations on pageIndex matching type.
getUnsavedAnnotations() Future<List<Annotation>>

Available on AnnotationManagerInterface, provided by the AnnotationManagerTyped extension

Returns the typed annotations that have unsaved changes.
getUnsavedAnnotationsJson() Future<String>
Returns a JSON string of all annotations that have unsaved changes.
importXfdf(String xfdfString) Future<bool>
Imports annotations from an XFDF string.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAnnotation(int pageIndex, String annotationId) Future<bool>
Removes the annotation at pageIndex with annotationId.
saveAnnotationProperties(AnnotationProperties properties) Future<bool>
Saves the given properties back to the annotation.
searchAnnotations(String query, {int? pageIndex}) Future<List<Annotation>>

Available on AnnotationManagerInterface, provided by the AnnotationManagerTyped extension

Searches annotations by query, returning typed results.
searchAnnotationsJson(String query, {int? pageIndex}) Future<String>
Searches annotations by query string (low-level transport).
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited