PolylineAnnotation class

PolylineAnnotation class

Represents polyline annotation properties.

Learn more:

The PolylineAnnotation type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of AreaAnnotation class.

Methods

Method Description
clone Returns new instance with the same values.
equals Compares this polyline annotation with another using the IEquatable Equals method.
equals Compares polyline annotation using standard object Equals method.
equals_object
equals_polyline_annotation
get_hash_code Returns hash code of the polyline annotation.
equals_annotation_base (inherited from AnnotationBase)

Properties

Property Description
box The polyline annotation position as a Rectangle.
opacity The polyline annotation opacity.
pen_color The pen color of the polyline annotation.
pen_style The pen style of the polyline annotation.
pen_width The polyline annotation pen width.
svg_path The SVG path of the polyline 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 PolylineAnnotation
from groupdocs.pydrawing import Color


def add_polyline_annotation():
    with Annotator("./sample.pdf") as annotator:
        polyline = PolylineAnnotation()
        polyline.box = Rectangle(100, 100, 200, 100)
        polyline.svg_path = "M 0 0 L 50 50 L 100 0 L 150 50"
        polyline.pen_color = Color.purple.to_argb()
        polyline.pen_width = 2
        polyline.pen_style = PenStyle.SOLID
        polyline.opacity = 0.9
        polyline.page_number = 0
        polyline.message = "This is a polyline annotation"
        annotator.add(polyline)
        annotator.save("./output.pdf")


if __name__ == "__main__":
    add_polyline_annotation()

Guides

Task guides that use PolylineAnnotation:

See Also