InkAnnotation

Overview

InkAnnotation is a class in Aspose.PDF FOSS for Python. Inherits from: MarkupAnnotation.

Freehand strokes (Ink).

This class declares 7 methods for InkAnnotation objects in Python programs. Available methods include: __init__, add_popup, generate_appearance, get_property, reply, set_property, update_properties. Public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package. Properties: appearance_normal, author, border_dash, border_style, border_width, contents, and 9 more.

Properties

NameTypeAccessDescription
border_widthfloat | NoneRead/WriteThe border’s width in points (/BS /W), or None when unset.
border_stylestr | NoneRead/WriteThe border’s style (/BS /S): S, D, B, I or U.
border_dashtuple[float, ...]Read/WriteThe dash pattern of a dashed border (/BS /D), empty when unset.
subtypestrReadGets the subtype.
contentsstrRead/WriteGets or sets the contents.
recttuple[float, float, float, float]Read/WriteGets or sets the rect.
titlestrRead/WriteGets or sets the title.
authorstrRead/WriteGets or sets the author.
has_appearanceboolReadGets the has appearance.
appearance_normalbytesRead/WriteGets or sets the appearance normal.
propertiesdict[str, Any]ReadType-specific annotation entries beyond the common fields.
in_reply_toAnnotation | NoneReadThe annotation this one replies to (/IRT), or None.
replieslist[Annotation]ReadEvery annotation on this page that replies to this one (/IRT).
popupAnnotation | NoneReadThe popup window this annotation owns (/Popup), or None.
parent_annotationAnnotation | NoneReadThe annotation a popup belongs to (/Parent), or None.

Methods

SignatureDescription
__init__(page: Page, index: int, data: dict[str, Any])Calls init(page, index, data) on this InkAnnotation instance.
get_property(name: str, default: Any) → AnyReturn a single type-specific property value (or default).
set_property(name: str, value: Any)Set a single type-specific property (value=None removes it).
update_properties()Set several type-specific properties at once.
reply(contents: str, title: str | None, rect: tuple[float, float, float, float] | None, subtype: str, properties: dict[str, Any] | None) → AnnotationAdd an annotation replying to this one, and return it.
add_popup(rect: tuple[float, float, float, float] | None, is_open: bool) → AnnotationAdd this annotation’s popup window, linked both ways, and return it.
generate_appearance(force: bool) → boolSynthesise a normal appearance stream (/AP /N) for this annotation.

See Also