com.groupdocs.annotation

Class Annotator

  • All Implemented Interfaces:
    com.aspose.ms.System.IDisposable, Closeable, AutoCloseable


    public class Annotator
    extends Object
    implements com.aspose.ms.System.IDisposable, Closeable

    Represents main class that controls document annotating process.

    • Constructor Detail

      • Annotator

        public Annotator(InputStream document)

        Initialise annotator class which accept document stream

        Parameters:
        document - Document stream


        <b>Learn more</b>
      • Annotator

        public Annotator(InputStream document,
                 AnnotatorSettings settings)

        Initialise annotator class which accept document stream

        Parameters:
        document - Document stream
        settings - Annotator settings


        <b>Learn more</b>
      • Annotator

        public Annotator(InputStream document,
                 LoadOptions loadOptions)

        Initialise annotator class which accept document stream

        Parameters:
        document - Document stream
        loadOptions - Load options


        <b>Learn more</b>
      • Annotator

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

        Initialise annotator class which accept document stream

        Parameters:
        document - Document stream
        loadOptions - Load options
        settings - Annotator settings


        <b>Learn more</b>
      • Annotator

        public Annotator(com.aspose.ms.System.IO.Stream document)
      • Annotator

        public Annotator(com.aspose.ms.System.IO.Stream document,
                 AnnotatorSettings settings)
      • Annotator

        public Annotator(com.aspose.ms.System.IO.Stream document,
                 LoadOptions loadOptions)
      • Annotator

        public Annotator(String filePath)

        Initialise annotator class which accept document path

        Parameters:
        filePath - File path


        <b>Learn more</b>
      • Annotator

        public Annotator(String filePath,
                 AnnotatorSettings settings)

        Initialise annotator class which accept document path

        Parameters:
        filePath - File path
        settings - Annotator settings


        <b>Learn more</b>
      • Annotator

        public Annotator(String filePath,
                 LoadOptions loadOptions)

        Initialise annotator class which accept document path

        Parameters:
        filePath - File path
        loadOptions - Load options


        <b>Learn more</b>
      • Annotator

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

        Initialise annotator class which accept document path

        Parameters:
        filePath - File path
        loadOptions - Load options
        settings - Annotator settings


        <b>Learn more</b>
    • Method Detail

      • add

        public final void add(AnnotationBase annotation)

        Adds annotation to document

        Parameters:
        annotation - The annotation to add.


        <b>Learn more</b>
      • add

        public final void add(List<AnnotationBase> annotations)

        Adds collection of annotations to a document.

        Parameters:
        annotations - The annotations list to add.


        <b>Learn more</b>
      • dispose

        public final void dispose()

        Dispose

        Specified by:
        dispose in interface com.aspose.ms.System.IDisposable
      • get

        public final List<AnnotationBase> get()

        Gets collections of document annotations.

        Returns:
        The list of annotations.


        <b>Learn more</b>
      • get

        public final List<AnnotationBase> get(int type)

        Gets collection of document annotations by annotation type.

        Parameters:
        type - The annotations type that must be returned.


        <b>Learn more</b>
        Returns:
        The list of annotations by type.
      • getDocument

        public final Document getDocument()

        Document

        Returns:
      • getVersion

        public final List<AnnotationBase> getVersion(Object version)

        Get annotations from versions.

        Parameters:
        version - The version's Key of versions which you want to return
        Returns:
        The list of annotations from specific versions. If null will return last.
      • getVersionsList

        public final List<Object> getVersionsList()

        Get versions.

        Returns:
        The list of versions.
      • remove

        public final void remove(AnnotationBase annotation)

        Removes annotation from document.

        Parameters:
        annotation - Annotation that must be removed.


        <b>Learn more</b>
      • remove

        public final void remove(int annotationId)

        Removes annotation from document by Id.

        Parameters:
        annotationId - The annotation's id that must be removed.


        <b>Learn more</b>
      • remove

        public final void remove(List<Integer> annotationIds)

        Removes collection of annotations from document by provided annotation ids.

        Parameters:
        annotationIds - The annotation's id that must be removed.


        <b>Learn more</b>
      • removeInternal

        public final void removeInternal(List<AnnotationBase> annotationsToDelete)

        Removes collection of annotations from document.

        Parameters:
        annotationsToDelete - The annotations that must be removed.


        <b>Learn more</b>
      • save

        public final void save()

        Saves document after adding, updating or removing annotations.


        <b>Learn more about saving annotated documents</b>
      • save

        public final void save(InputStream document)

        Saves document after adding, updating or removing annotations.

        Parameters:
        document - The output stream.


        <b>Learn more about saving annotated documents</b>
      • save

        public final void save(InputStream document,
                SaveOptions saveOptions)

        Saves document after adding, updating or removing annotations.

        Parameters:
        document - The output stream.
        saveOptions - The save options.


        <b>Learn more about saving annotated documents</b>
      • save

        public final void save(SaveOptions saveOptions)

        Saves document after adding, updating or removing annotations.

        Parameters:
        saveOptions - The save options.


        <b>Learn more about saving annotated documents</b>
      • save

        public final void save(String filePath)

        Saves document after adding, updating or removing annotations.

        Parameters:
        filePath - The output file path.


        <b>Learn more about saving annotated documents</b>
      • save

        public final void save(String filePath,
                SaveOptions saveOptions)

        Saves document after adding, updating or removing annotations.

        Parameters:
        filePath - The output file path.
        saveOptions - The save options.


        <b>Learn more about saving annotated documents</b>
      • saveInternal

        public final void saveInternal(com.aspose.ms.System.IO.Stream document,
                        SaveOptions saveOptions)
      • update

        public final void update(AnnotationBase newAnnotation)

        Updates document annotation.

        Parameters:
        newAnnotation - The annotation to update (Id should be provided).


        <b>Learn more</b>
      • update

        public final void update(List<AnnotationBase> annotations)

        Updates collection of document annotations.

        Parameters:
        annotations - The annotations list that will be set.


        <b>Learn more</b>