add method
Contents
[
Hide
]
add
Adds annotation to document.
Learn more
- More about how to add annotation to document: How to annotate document in C# (https://docs.groupdocs.com/display/annotationnet/Add+annotation+to+the+document)
def add(self, annotation):
...
| Parameter | Type | Description |
|---|---|---|
| annotation | AnnotationBase |
The annotation to add. |
Returns: None.
Example
from groupdocs.annotation import Annotator
from groupdocs.annotation.models import Rectangle
from groupdocs.annotation.models.annotation_models import PointAnnotation
with Annotator("./sample.pdf") as annotator:
point = PointAnnotation()
point.box = Rectangle(100, 100, 0, 0)
point.page_number = 0
point.message = "This is a point annotation"
annotator.add(point)
annotator.save("./output.pdf")
add
Adds a collection of annotations to a document.
Learn more
- More about how to add annotation to document: How to annotate document in C#
def add(self, annotations):
...
| Parameter | Type | Description |
|---|---|---|
| annotations | List[AnnotationBase] |
The annotations list to add. |
Returns: None.
Example
from groupdocs.annotation import Annotator
from groupdocs.annotation.models import Rectangle
from groupdocs.annotation.models.annotation_models import PointAnnotation
def add_point_annotation():
with Annotator("./sample.pdf") as annotator:
point = PointAnnotation()
point.box = Rectangle(100, 100, 0, 0) # a point is positioned by its box origin
point.page_number = 0
point.message = "This is a point annotation"
annotator.add([point])
annotator.save("./output.pdf")
See Also
- class
Annotator