public class

AnnotationProvider

extends Object
java.lang.Object
   ↳ com.pspdfkit.api.annotations.AnnotationProvider

Class Overview

Handles all annotation related operations on the owning document. Retrieve it with getAnnotationProvider().

Summary

Public Constructors
AnnotationProvider(NativeDocument nativeDocument)
Public Methods
JSONObject addAnnotationJson(JSONObject jsonAnnotation)
Add an annotation to the document.
JSONArray getAnnotationsJson(int pageIndex)
Get all the annotations on the given page.
void removeAnnotation(int pageIndex, long pdfObjectId)
Remove an annotation with the given PDF object ID.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public AnnotationProvider (NativeDocument nativeDocument)

Public Methods

public JSONObject addAnnotationJson (JSONObject jsonAnnotation)

Add an annotation to the document. For information on Annotation json format see JSON Format

Parameters
jsonAnnotation The annotation to add.
Returns
  • A JSONObject representation of the created annotation.

public JSONArray getAnnotationsJson (int pageIndex)

Get all the annotations on the given page. The format of the annotation Json can be found at https://pspdfkit.com/guides/server/current/server-api/json-format/

Parameters
pageIndex The page index to get annotations for.
Returns
  • A Json array of annotations.

public void removeAnnotation (int pageIndex, long pdfObjectId)

Remove an annotation with the given PDF object ID.

Parameters
pageIndex The page index where the annotation is located.
pdfObjectId Object ID of the annotation to remove.