DistanceAnnotation class
Leave feedback
On this page
Represents distance annotation properties.
Learn more:
- More about annotation types and annotating PDF and Microsoft Word documents, Excel spreadsheets and PowerPoint Presentations: How to annotate documents using GroupDocs.Annotation for .NET
- More about adding distance annotations to documents of various types: How to add distance annotations in C#
The DistanceAnnotation type exposes the following members:
| Constructor | Description |
|---|---|
| init | Initializes a new instance of DistanceAnnotation. |
| Method | Description |
|---|---|
| clone | Returns a new instance with the same values. |
| equals | Compares this distance annotation with another using the IEquatable Equals method. |
| equals | Compares distance annotation using standard object Equals method. |
| equals_distance_annotation | |
| equals_object | |
| get_hash_code | Returns HashCode of the distance annotation. |
| equals_annotation_base | (inherited from AnnotationBase) |
| Property | Description |
|---|---|
| box | The distance annotation position. |
| opacity | The opacity of the distance annotation. |
| pen_color | The pen color of the distance annotation. |
| pen_style | The pen style of the distance annotation. |
| pen_width | The distance annotation pen width. |
| 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) |
from groupdocs.annotation import Annotator
from groupdocs.annotation.models import Rectangle, PenStyle
from groupdocs.annotation.models.annotation_models import DistanceAnnotation
from groupdocs.pydrawing import Color
def add_distance_annotation():
with Annotator("./sample.pdf") as annotator:
distance = DistanceAnnotation()
distance.box = Rectangle(100, 100, 100, 100)
distance.pen_color = Color.blue.to_argb()
distance.pen_width = 2
distance.pen_style = PenStyle.SOLID
distance.opacity = 0.7
distance.page_number = 0
distance.message = "This is a distance annotation"
annotator.add(distance)
annotator.save("./output.pdf")
Task guides that use DistanceAnnotation:
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.