Represents a base annotation in a PDF document.

from nutrient import PdfAnnotation

Methods

set_border_style

def set_border_style(self, value: PdfBorderStyle) -> None

Sets the border style of the annotation.

Parameters:

NameTypeDescription
valuePdfBorderStyleThe value to set for the BorderStyle property.

set_border_width

def set_border_width(self, value: float) -> None

Sets the border width of the annotation in points.

Parameters:

NameTypeDescription
valuefloatThe value to set for the BorderWidth property.

set_color

def set_color(self, value: Color) -> None

Sets the annotation color.

Parameters:

NameTypeDescription
valueColorThe value to set for the Color property.

set_contents

def set_contents(self, value: str) -> None

Sets the annotation’s text contents.

Parameters:

NameTypeDescription
valuestrThe value to set for the Contents property.

set_is_hidden

def set_is_hidden(self, value: bool) -> None

Sets whether the annotation is hidden.

Parameters:

NameTypeDescription
valueboolThe value to set for the IsHidden property.

set_is_printable

def set_is_printable(self, value: bool) -> None

Sets whether the annotation is printable.

Parameters:

NameTypeDescription
valueboolThe value to set for the IsPrintable property.

set_rect

def set_rect(self, value: Any) -> None

Sets the rectangle that defines the location and size of the annotation on the page.

Parameters:

NameTypeDescription
valueAnyThe value to set for the Rect property.

set_title

def set_title(self, value: str) -> None

Sets the annotation’s title/author.

Parameters:

NameTypeDescription
valuestrThe value to set for the Title property.

Properties

border_style

@property
def border_style(self) -> PdfBorderStyle

Gets the border style of the annotation.

Type: PdfBorderStyle

Read-only property.


border_width

@property
def border_width(self) -> float

Gets the border width of the annotation in points.

Type: float

Read-only property.


color

@property
def color(self) -> Color

Gets the annotation color.

Type: Color

Read-only property.


contents

@property
def contents(self) -> str

Gets the annotation’s text contents.

Type: str

Read-only property.


index

@property
def index(self) -> int

Gets the 0-based index of this annotation in the page’s annotation array.

Type: int

Read-only property.


is_hidden

@property
def is_hidden(self) -> bool

Gets whether the annotation is hidden.

Type: bool

Read-only property.


is_printable

@property
def is_printable(self) -> bool

Gets whether the annotation is printable.

Type: bool

Read-only property.


modification_date

@property
def modification_date(self) -> str

Gets the annotation’s modification date.

Type: str

Read-only property.


name

@property
def name(self) -> str

Gets the annotation’s unique name/identifier.

Type: str

Read-only property.


rect

@property
def rect(self) -> Any

Gets the rectangle that defines the location and size of the annotation on the page.

Type: Any

Read-only property.


sub_type

@property
def sub_type(self) -> str

Gets the annotation subtype (e.g., “Text”, “Link”, “Highlight”).

Type: str

Read-only property.


title

@property
def title(self) -> str

Gets the annotation’s title/author.

Type: str

Read-only property.