LinkAnnotation class

LinkAnnotation class

Represents link annotation properties.

Learn more

The LinkAnnotation type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of LinkAnnotation.

Methods

Method Description
clone Returns a new instance with the same values.
equals Compares this link annotation with another using the IEquatable Equals method.
equals Compares link annotation using standard object Equals method.
equals_link_annotation
equals_object
get_hash_code Returns HashCode of link annotation.
equals_annotation_base (inherited from AnnotationBase)

Properties

Property Description
background_color The background color of the link annotation.
font_color The text color of the link annotation.
opacity The opacity of the link annotation.
points The link annotation coordinates as a list of points.
url The annotation link URL.
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 Point
from groupdocs.annotation.models.annotation_models import LinkAnnotation
from groupdocs.pydrawing import Color

def add_link_annotation():
    with Annotator("./sample.pdf") as annotator:
        link = LinkAnnotation()
        link.points = [
            Point(80, 600), Point(300, 600),
            Point(80, 575), Point(300, 575),
        ]
        link.url = "https://www.groupdocs.com"
        link.background_color = Color.azure.to_argb()
        link.opacity = 0.7
        link.page_number = 0
        link.message = "This is a link annotation"
        annotator.add(link)
        annotator.save("./output.pdf")

Guides

Task guides that use LinkAnnotation:

See Also