update method

Contents
[ ]

update

Updates document annotation by id.

Learn more

def update(self, new_annotation):
    ...
Parameter Type Description
new_annotation AnnotationBase The annotation to update (Id should be provided).

Example

from groupdocs.annotation import Annotator

with Annotator("annotated.pdf") as annotator:
    annotations = annotator.get()
    annotator.update(annotations[0])

update

Updates collection of document annotations by overriding the previous list with a new one.

def update(self, annotations):
    ...
Parameter Type Description
annotations List[AnnotationBase] The annotations list that will be set.

Example

from groupdocs.annotation import Annotator

with Annotator("annotated.pdf") as annotator:
    all_annotations = annotator.get()
    # modify an annotation as needed
    annotator.update([all_annotations[0]])  # replace the current list with the modified annotation
    annotator.save("edited.pdf")

See Also