get method

Contents
[ ]

get

Gets collections of document annotations.

Learn more:

def get(self):
    ...

Returns: The list of annotations.

Example

from groupdocs.annotation import Annotator


def get_all_annotations():
    # Open a document that already contains annotations and list them
    with Annotator("./annotated.pdf") as annotator:
        annotations = annotator.get()
        print(f"Found {len(annotations)} annotation(s):")
        for annotation in annotations:
            print(f"  [{annotation.id}] {type(annotation).__name__}: {annotation.message}")


if __name__ == "__main__":
    get_all_annotations()

get

Returns a collection of document annotations filtered by the specified annotation type.

def get(self, type):
    ...
Parameter Type Description
type AnnotationType The annotation type that must be returned.

Returns: list[GroupDocs.Annotation.Annotation]: The list of annotations of the specified type.

Example

from groupdocs.annotation import Annotator


def get_all_annotations():
    # Open a document that already contains annotations and list them
    with Annotator("./annotated.pdf") as annotator:
        annotations = annotator.get()
        print(f"Found {len(annotations)} annotation(s):")
        for annotation in annotations:
            print(f"  [{annotation.id}] {type(annotation).__name__}: {annotation.message}")


if __name__ == "__main__":
    get_all_annotations()

See Also