Annotator

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.ms.System.IDisposable, java.io.Closeable

public class Annotator implements System.IDisposable, Closeable

Represents main class that controls document annotating process.

Constructors

Constructor Description
Annotator(String filePath) Initialise annotator class which accept document path
Annotator(String filePath, LoadOptions loadOptions) Initialise annotator class which accept document path
Annotator(String filePath, AnnotatorSettings settings) Initialise annotator class which accept document path
Annotator(String filePath, LoadOptions loadOptions, AnnotatorSettings settings) Initialise annotator class which accept document path
Annotator(InputStream inputStream) Initialise annotator class which accept document stream
Annotator(InputStream inputStream, LoadOptions loadOptions) Initialise annotator class which accept document stream
Annotator(InputStream inputStream, AnnotatorSettings settings) Initialise annotator class which accept document stream
Annotator(InputStream inputStream, LoadOptions loadOptions, AnnotatorSettings settings) Initialise annotator class which accept inputStream stream

Methods

Method Description
getDocument() Document
getRotation() Document Rotation
setRotation(Byte value) Document Rotation
getProcessPages() Document pages
setProcessPages(int value) Document pages
save() Saves document after adding, updating or removing annotations.
save(SaveOptions saveOptions) Saves document after adding, updating or removing annotations.
save(OutputStream document) Saves document after adding, updating or removing annotations.
save(String filePath) Saves document after adding, updating or removing annotations.
save(OutputStream outputStream, SaveOptions saveOptions) Saves outputStream after adding, updating or removing annotations.
save(String filePath, SaveOptions saveOptions) Saves document after adding, updating or removing annotations.
dispose() Dispose
add(AnnotationBase annotation) Adds annotation to document
add(List annotations) Adds collection of annotations to a document.
update(AnnotationBase newAnnotation) Updates document annotation.
update(List annotations) Updates collection of document annotations.
remove(int annotationId) Removes annotation from document by Id.
remove(AnnotationBase annotation) Removes annotation from document.
remove(AnnotationBase[] annotationsToDelete) Removes collection of annotations from document by provided annotation ids.
remove(List annotationsIdsToDelete) Removes collection of annotations from document by provided annotation ids.
removeInternal(List annotationsToDelete) Removes collection of annotations from document.
get() Gets collections of document annotations.
getVersionsList() Get versions.
getVersion(Object version) Get annotations from versions.
get(int type) Gets collection of document annotations by annotation type.
importAnnotationsFromDocument(String outputPath) Import annotations from document to XML file.
exportAnnotationsFromDocument(String filePath) Export annotations from XML document.
close()

Annotator(String filePath)

public Annotator(String filePath)

Initialise annotator class which accept document path

Parameters:

Parameter Type Description
filePath java.lang.String File path

Learn more

  • |

Annotator(String filePath, LoadOptions loadOptions)

public Annotator(String filePath, LoadOptions loadOptions)

Initialise annotator class which accept document path

Parameters:

Parameter Type Description
filePath java.lang.String File path
loadOptions LoadOptions Load options

Learn more

  • |

Annotator(String filePath, AnnotatorSettings settings)

public Annotator(String filePath, AnnotatorSettings settings)

Initialise annotator class which accept document path

Parameters:

Parameter Type Description
filePath java.lang.String File path
settings AnnotatorSettings Annotator settings

Learn more

  • |

Annotator(String filePath, LoadOptions loadOptions, AnnotatorSettings settings)

public Annotator(String filePath, LoadOptions loadOptions, AnnotatorSettings settings)

Initialise annotator class which accept document path

Parameters:

Parameter Type Description
filePath java.lang.String File path
loadOptions LoadOptions Load options
settings AnnotatorSettings Annotator settings

Learn more

  • |

Annotator(InputStream inputStream)

public Annotator(InputStream inputStream)

Initialise annotator class which accept document stream

Parameters:

Parameter Type Description
inputStream java.io.InputStream Document stream

Learn more

  • |

Annotator(InputStream inputStream, LoadOptions loadOptions)

public Annotator(InputStream inputStream, LoadOptions loadOptions)

Initialise annotator class which accept document stream

Parameters:

Parameter Type Description
inputStream java.io.InputStream Document stream
loadOptions LoadOptions Load options

Learn more

  • |

Annotator(InputStream inputStream, AnnotatorSettings settings)

public Annotator(InputStream inputStream, AnnotatorSettings settings)

Initialise annotator class which accept document stream

Parameters:

Parameter Type Description
inputStream java.io.InputStream Document stream
settings AnnotatorSettings Annotator settings

Learn more

  • |

Annotator(InputStream inputStream, LoadOptions loadOptions, AnnotatorSettings settings)

public Annotator(InputStream inputStream, LoadOptions loadOptions, AnnotatorSettings settings)

Initialise annotator class which accept inputStream stream

Parameters:

Parameter Type Description
inputStream java.io.InputStream Document stream
loadOptions LoadOptions Load options
settings AnnotatorSettings Annotator settings

Learn more

  • |

getDocument()

public final Document getDocument()

Document

Returns: Document -

getRotation()

public final Byte getRotation()

Document Rotation

Returns: java.lang.Byte -

setRotation(Byte value)

public final void setRotation(Byte value)

Document Rotation

Parameters:

Parameter Type Description
value java.lang.Byte

getProcessPages()

public final int getProcessPages()

Document pages

Returns: int -

setProcessPages(int value)

public final void setProcessPages(int value)

Document pages

Parameters:

Parameter Type Description
value int

save()

public final void save()

Saves document after adding, updating or removing annotations.


Learn more about saving annotated documents

save(SaveOptions saveOptions)

public final void save(SaveOptions saveOptions)

Saves document after adding, updating or removing annotations.

Parameters:

Parameter Type Description
saveOptions SaveOptions The save options.

Learn more about saving annotated documents

  • |

save(OutputStream document)

public final void save(OutputStream document)

Saves document after adding, updating or removing annotations.

Parameters:

Parameter Type Description
document java.io.OutputStream The output stream.

Learn more about saving annotated documents

  • |

save(String filePath)

public final void save(String filePath)

Saves document after adding, updating or removing annotations.

Parameters:

Parameter Type Description
filePath java.lang.String The output file path.

Learn more about saving annotated documents

  • |

save(OutputStream outputStream, SaveOptions saveOptions)

public final void save(OutputStream outputStream, SaveOptions saveOptions)

Saves outputStream after adding, updating or removing annotations.

Parameters:

Parameter Type Description
outputStream java.io.OutputStream The output stream.
saveOptions SaveOptions The save options.

Learn more about saving annotated documents

  • |

save(String filePath, SaveOptions saveOptions)

public final void save(String filePath, SaveOptions saveOptions)

Saves document after adding, updating or removing annotations.

Parameters:

Parameter Type Description
filePath java.lang.String The output file path.
saveOptions SaveOptions The save options.

Learn more about saving annotated documents

  • |

dispose()

public final void dispose()

Dispose

add(AnnotationBase annotation)

public final void add(AnnotationBase annotation)

Adds annotation to document

Parameters:

Parameter Type Description
annotation AnnotationBase The annotation to add.

Learn more

  • |

add(List annotations)

public final void add(List<AnnotationBase> annotations)

Adds collection of annotations to a document.

Parameters:

Parameter Type Description
annotations java.util.List<com.groupdocs.annotation.models.annotationmodels.AnnotationBase> The annotations list to add.

Learn more

  • |

update(AnnotationBase newAnnotation)

public final void update(AnnotationBase newAnnotation)

Updates document annotation.

Parameters:

Parameter Type Description
newAnnotation AnnotationBase The annotation to update (Id should be provided).

Learn more

  • |

update(List annotations)

public final void update(List<AnnotationBase> annotations)

Updates collection of document annotations.

Parameters:

Parameter Type Description
annotations java.util.List<com.groupdocs.annotation.models.annotationmodels.AnnotationBase> The annotations list that will be set.

Learn more

  • |

remove(int annotationId)

public final void remove(int annotationId)

Removes annotation from document by Id.

Parameters:

Parameter Type Description
annotationId int The annotation’s id that must be removed.

Learn more

  • |

remove(AnnotationBase annotation)

public final void remove(AnnotationBase annotation)

Removes annotation from document.

Parameters:

Parameter Type Description
annotation AnnotationBase Annotation that must be removed.

Learn more

  • |

remove(AnnotationBase[] annotationsToDelete)

public final void remove(AnnotationBase[] annotationsToDelete)

Removes collection of annotations from document by provided annotation ids.

Parameters:

Parameter Type Description
annotationsToDelete AnnotationBase[] The annotation’s id that must be removed.

Learn more

  • |

remove(List annotationsIdsToDelete)

public final void remove(List<Integer> annotationsIdsToDelete)

Removes collection of annotations from document by provided annotation ids.

Parameters:

Parameter Type Description
annotationsIdsToDelete java.util.List<java.lang.Integer> The annotation’s id that must be removed.

Learn more

  • |

removeInternal(List annotationsToDelete)

public final void removeInternal(List<AnnotationBase> annotationsToDelete)

Removes collection of annotations from document.

Parameters:

Parameter Type Description
annotationsToDelete java.util.List<com.groupdocs.annotation.models.annotationmodels.AnnotationBase> The annotations that must be removed.

Learn more

  • |

get()

public final List<AnnotationBase> get()

Gets collections of document annotations.

Returns: java.util.List<com.groupdocs.annotation.models.annotationmodels.AnnotationBase> - The list of annotations.


Learn more

Get versions.

Returns: java.util.List<java.lang.Object> - The list of versions.

getVersion(Object version)

public final List<AnnotationBase> getVersion(Object version)

Get annotations from versions.

Parameters:

Parameter Type Description
version java.lang.Object The version’s Key of versions which you want to return

Returns: java.util.List<com.groupdocs.annotation.models.annotationmodels.AnnotationBase> - The list of annotations from specific versions. If null will return last.

get(int type)

public final List<AnnotationBase> get(int type)

Gets collection of document annotations by annotation type.

Parameters:

Parameter Type Description
type int The annotations type that must be returned.

Learn more

  • |

Returns: java.util.List<com.groupdocs.annotation.models.annotationmodels.AnnotationBase> - The list of annotations by type.

importAnnotationsFromDocument(String outputPath)

public final void importAnnotationsFromDocument(String outputPath)

Import annotations from document to XML file.

Parameters:

Parameter Type Description
outputPath java.lang.String The output file path.

Learn more

  • |

exportAnnotationsFromDocument(String filePath)

public final void exportAnnotationsFromDocument(String filePath)

Export annotations from XML document.

Parameters:

Parameter Type Description
filePath java.lang.String The input file path.

Learn more

  • |

close()

public void close()