AnnotationProvider

Handles all annotation related operations on the owning document. Retrieve it with com.pspdfkit.document.PdfDocument.getAnnotationProvider.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Listener for annotation update events inside AnnotationProvider.

Functions

Link copied to clipboard
abstract fun addAnnotationToPage(annotation: Annotation)

Adds annotation to the owner PDF document. The annotation will be attached to the page set in its constructor.

abstract fun addAnnotationToPage(annotation: Annotation, zIndex: Int)

Adds annotation to the owner PDF document at the specified z-index. The annotation will be attached to the page set in its constructor.

Link copied to clipboard
abstract fun addAnnotationToPageAsync(annotation: Annotation): Completable

Adds annotation to the owner PDF document asynchronously. The annotation will be attached to the page set in its constructor.

abstract fun addAnnotationToPageAsync(annotation: Annotation, zIndex: Int): Completable

Adds annotation to the owner PDF document asynchronously, at the specified z-index. The annotation will be attached to the page set in its constructor.

Link copied to clipboard
abstract fun addAppearanceStreamGenerator(appearanceStreamGenerator: AppearanceStreamGenerator)
abstract fun addAppearanceStreamGenerator(appearanceStreamGenerator: AppearanceStreamGenerator, addFirst: Boolean)

Adds appearance stream generator to the list of global appearance stream generators.

Link copied to clipboard
abstract fun appendAnnotationState(annotation: Annotation, annotationStateChange: AnnotationStateChange)

Appends a new annotation state for the given annotation (adds it to the review history).

Link copied to clipboard
abstract fun appendAnnotationStateAsync(annotation: Annotation, annotationStateChange: AnnotationStateChange): Completable

Appends a new annotation state for the given annotation asynchronously (adds it to the review history).

Link copied to clipboard
abstract fun createAnnotationFromInstantJson(annotationJson: String): Annotation

Creates an annotation from the Instant JSON annotation format. The JSON must contain the type, the page number and any other required properties for that type. The created annotation will be automatically added to the document, and any registered OnAnnotationUpdatedListener will be notified of the creation.

Link copied to clipboard
abstract fun createAnnotationFromInstantJsonAsync(annotationJson: String): Single<Annotation>

Creates an annotation from the Instant JSON annotation format asynchronously. The JSON must contain the type, the page number and any other required properties for that type. The created annotation will be automatically added to the document, and any registered OnAnnotationUpdatedListener will be notified of the creation.

Link copied to clipboard
abstract fun getAllAnnotationsOfType(types: EnumSet<ERROR CLASS: Symbol not found for AnnotationType>): List<Annotation>

Returns all annotations of passed types in this document.

abstract fun getAllAnnotationsOfType(types: EnumSet<ERROR CLASS: Symbol not found for AnnotationType>, startIndex: Int, pageCount: Int): List<Annotation>

Returns all annotations of passed types in the specified page index range.

Link copied to clipboard
abstract fun getAllAnnotationsOfTypeAsync(types: EnumSet<ERROR CLASS: Symbol not found for AnnotationType>): Observable<Annotation>

Returns all annotations of passed types in this document.

abstract fun getAllAnnotationsOfTypeAsync(types: EnumSet<ERROR CLASS: Symbol not found for AnnotationType>, startIndex: Int, pageCount: Int): Observable<Annotation>

Returns all annotations of passed types in the specified page index range.

Link copied to clipboard
abstract fun getAnnotation(@IntRange(from = 0) pageIndex: Int, objectNumber: Int): Annotation?

Returns annotation with certain object ID on the page if it exists.

Link copied to clipboard
abstract fun getAnnotationAsync(@IntRange(from = 0) pageIndex: Int, objectNumber: Int): Maybe<Annotation>

Returns annotation with certain object ID on the page if it exists, asynchronously.

Link copied to clipboard
abstract fun getAnnotationReplies(annotation: Annotation): List<Annotation>

Gets all first-level replies to a particular annotation. First-level replies are annotations that return the given annotation via Annotation.getInReplyTo. The sort order is determined by the creation date.

Link copied to clipboard
abstract fun getAnnotationRepliesAsync(annotation: Annotation): Single<List<Annotation>>

Gets all first-level replies to a particular annotation asynchronously. First-level replies are annotations that return the given annotation via Annotation.getInReplyTo. The sort order is determined by the creation date.

Link copied to clipboard
abstract fun getAnnotations(@IntRange(from = 0) pageIndex: Int): List<Annotation>

Returns a list of annotations on the page. For annotations not currently recognised and handled by Nutrient this returns UnknownAnnotation.

abstract fun getAnnotations(objectNumbers: Collection<Int>): List<Annotation>

Returns annotations with given object numbers.

Link copied to clipboard
abstract fun getAnnotationsAsync(@IntRange(from = 0) pageIndex: Int): Observable<List<Annotation>>

Returns list of annotations on the page. For annotations not currently recognised and handled by Nutrient this returns UnknownAnnotation.

abstract fun getAnnotationsAsync(objectNumbers: Collection<Int>): Observable<List<Annotation>>

Returns annotations with given object numbers, asynchronously.

Link copied to clipboard
abstract fun getAnnotationsJson(@IntRange(from = 0) pageIndex: Int): String

Returns a JSON array in string format of annotations on the page.

Link copied to clipboard

Gets all flattened replies (all replies included but no nesting) to a particular annotation. The sort order is determined by the creation date.

Link copied to clipboard
abstract fun getFlattenedAnnotationRepliesAsync(annotation: Annotation): Single<List<Annotation>>

Gets all flattened replies (all replies included but no nesting) to a particular annotation asynchronously. The sort order is determined by the creation date.

Link copied to clipboard

Gets the review history of an annotation. The review history of an annotation is the list of states it has passed, for example, "Accepted", "Cancelled", and so on. This list is ordered chronologically, where the last element is the most current one according to the creation date of the annotation change.

Link copied to clipboard
abstract fun getReviewHistoryAsync(annotation: Annotation): Single<List<AnnotationStateChange>>

Gets the review history of an annotation asynchronously. The review history of an annotation is the list of states it has passed, for example, "Accepted", "Cancelled", and so on. This list is ordered chronologically, where the last element is the most current one according to the creation date of the annotation change.

Link copied to clipboard
abstract fun getReviewSummary(annotation: Annotation, currentUser: String?): AnnotationReviewSummary?

Gets a summary information about the given annotation's review state.

Link copied to clipboard
abstract fun getReviewSummaryAsync(annotation: Annotation, currentUser: String?): Maybe<AnnotationReviewSummary>

Gets a summary information about the given annotation's review state asynchronously.

Link copied to clipboard
abstract fun getZIndex(annotation: Annotation): Int

Gets the z-index of the provided annotation.

Link copied to clipboard
abstract fun getZIndexAsync(annotation: Annotation): Single<Int>

Gets the z-index of the provided annotation.

Link copied to clipboard
abstract fun hasUnsavedChanges(): Boolean

Returns whether there are unsaved changes to annotations in this document.

Link copied to clipboard
abstract fun moveAnnotation(annotation: Annotation, zIndexMove: AnnotationZIndexMove)

Moves the annotation with the specified z-index move action.

abstract fun moveAnnotation(annotation: Annotation, zIndex: Int)
abstract fun moveAnnotation(pageIndex: Int, fromZIndex: Int, toZIndex: Int)

Moves the annotation to the specified z-index.

Link copied to clipboard
abstract fun moveAnnotationAsync(annotation: Annotation, zIndexMove: AnnotationZIndexMove): Completable

Moves the annotation with the specified z-index move action asynchronously.

abstract fun moveAnnotationAsync(annotation: Annotation, zIndex: Int): Completable
abstract fun moveAnnotationAsync(pageIndex: Int, fromZIndex: Int, toZIndex: Int): Completable

Moves the annotation to the specified z-index asynchronously.

Link copied to clipboard
abstract fun removeAnnotationFromPage(annotation: Annotation)

Removes annotation from the document. If the annotation is not attached to the document of this annotation provider, this will be a no-op. Note that when using the Replies component of Nutrient (requires extra license flag), any replies to the removed annotation will be automatically removed as well from the document.

Link copied to clipboard
abstract fun removeAnnotationFromPageAsync(annotation: Annotation): Completable

Removes annotation from this document asynchronously.

Link copied to clipboard
abstract fun removeAppearanceStreamGenerator(appearanceStreamGenerator: AppearanceStreamGenerator)

Remove appearance stream generator that was previously added in addAppearanceStreamGenerator.