EllipseAnnotation class
EllipseAnnotation class
Represents ellipse annotation properties.
Learn more
- More about annotation types and annotating PDF and Microsoft Word documents, Excel spreadsheets and PowerPoint Presentations: https://docs.groupdocs.com/display/annotationnet/Add+annotation+to+the+document
- More about adding ellipse annotations to documents of various types: https://docs.groupdocs.com/display/annotationnet/Add+ellipse+annotation
The EllipseAnnotation type exposes the following members:
Constructors
| Constructor | Description |
|---|---|
| init | Initializes new instance of EllipseAnnotation class. |
Methods
| Method | Description |
|---|---|
| clone | Returns a new instance with the same values. |
| equals | Compares this ellipse annotation with another using the IEquatable Equals method. |
| equals | Compares the ellipse annotation with another object using the standard object Equals method. |
| equals_ellipse_annotation | |
| equals_object | |
| get_hash_code | Returns the hash code of the ellipse annotation. |
| equals_annotation_base | (inherited from AnnotationBase) |
Properties
| Property | Description |
|---|---|
| background_color | The background color of the ellipse annotation. |
| box | The ellipse annotation position. |
| opacity | The opacity of the annotation. |
| pen_color | The pen color of the ellipse annotation. |
| pen_style | The pen style of the ellipse annotation. |
| pen_width | The pen width of the ellipse annotation. |
| created_on | The annotation creation date. (inherited from AnnotationBase) |
| id | The annotation unique identifier. This field is auto-incremented. (inherited from AnnotationBase) |
| message | The annotation message. (inherited from AnnotationBase) |
| page_number | The page number where the annotation should be located. (inherited from AnnotationBase) |
| replies | The list of replies (comments) attached to the annotation. (inherited from AnnotationBase) |
| state_before_annotation | The previous state of the text before annotating. (inherited from AnnotationBase) |
| type | The annotation type. (inherited from AnnotationBase) |
| user | The annotation author. (inherited from AnnotationBase) |
Example
from groupdocs.annotation import Annotator
from groupdocs.annotation.models import Rectangle, PenStyle
from groupdocs.annotation.models.annotation_models import EllipseAnnotation
from groupdocs.pydrawing import Color
def add_ellipse_annotation():
with Annotator("./sample.pdf") as annotator:
ellipse = EllipseAnnotation()
ellipse.box = Rectangle(100, 100, 200, 120)
ellipse.background_color = Color.from_argb(255, 144, 238, 144).to_argb()
ellipse.pen_color = Color.green.to_argb()
ellipse.pen_width = 2
ellipse.pen_style = PenStyle.SOLID
ellipse.opacity = 0.7
ellipse.page_number = 0
ellipse.message = "This is an ellipse annotation"
annotator.add(ellipse)
annotator.save("./output.pdf")
if __name__ == "__main__":
add_ellipse_annotation()
Guides
Task guides that use EllipseAnnotation: