ReplacementAnnotation class

ReplacementAnnotation class

Represents replacement annotation properties.

Learn more

The ReplacementAnnotation type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of ReplacementAnnotation.

Methods

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

Properties

Property Description
background_color The background color of the replacement annotation.
font_color The replacement annotation text color.
font_size The replacement annotation text size.
opacity The replacement annotation opacity.
points The collection of points that describe rectangles with text.
text_to_replace The text to be replaced.
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 ReplacementAnnotation
from groupdocs.pydrawing import Color


def add_replacement_annotation():
    with Annotator("./sample.pdf") as annotator:
        replacement = ReplacementAnnotation()
        replacement.points = [
            Point(80, 600), Point(300, 600),
            Point(80, 575), Point(300, 575),
        ]
        replacement.text_to_replace = "replacement text"
        replacement.font_color = Color.black.to_argb()
        replacement.font_size = 12.0
        replacement.opacity = 0.9
        replacement.page_number = 0
        replacement.message = "This is a text replacement annotation"
        annotator.add(replacement)
        annotator.save("./output.pdf")


if __name__ == "__main__":
    add_replacement_annotation()

Guides

Task guides that use ReplacementAnnotation:

See Also