AnnotationManagerInterface class abstract
Abstract interface for annotation operations on a PDF document.
Concrete implementations are provided by each platform package:
AnnotationManagerAndroidinnutrient_flutter_androidAnnotationManagerIOSinnutrient_flutter_iosAnnotationManagerWebinnutrient_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
Constructors
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 typedannotationto 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
pageIndexwithannotationId, ornullif not found. -
getAnnotations(
int pageIndex, [AnnotationType type = AnnotationType.all]) → Future< List< Annotation> > -
Available on AnnotationManagerInterface, provided by the AnnotationManagerTyped extension
Returns the typed annotations onpageIndex, optionally filtered bytype(defaults to all types). -
getAnnotationsJson(
int pageIndex, String type) → Future< String> -
Returns a JSON string of all annotations on
pageIndexmatchingtype. -
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
pageIndexwithannotationId. -
saveAnnotationProperties(
AnnotationProperties properties) → Future< bool> -
Saves the given
propertiesback to the annotation. -
searchAnnotations(
String query, {int? pageIndex}) → Future< List< Annotation> > -
Available on AnnotationManagerInterface, provided by the AnnotationManagerTyped extension
Searches annotations byquery, returning typed results. -
searchAnnotationsJson(
String query, {int? pageIndex}) → Future< String> -
Searches annotations by
querystring (low-level transport). -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited