pdftools_toolbox.pdf.annotations.line_annotation

Classes

LineAnnotation(handle)

A line annotation

class pdftools_toolbox.pdf.annotations.line_annotation.LineAnnotation(handle)[source]

Bases: DrawingAnnotation

A line annotation

An annotation that draws a line on a page.

static create(target_document: Document, start: Point, end: Point, stroke: Stroke) LineAnnotation | None[source]

Create a line annotation.

The returned line annotation is not yet part of any page. It can be added to a page’s list of annotations.

Parameters:
Returns:

The newly created line annotation.

Return type:

Optional[pdftools_toolbox.pdf.annotations.line_annotation.LineAnnotation]

Raises:
property start: Point

The line’s starting point

Returns:

pdftools_toolbox.geometry.real.point.Point

Raises:

StateError – if the object has already been closed

property end: Point

The line’s ending point

Returns:

pdftools_toolbox.geometry.real.point.Point

Raises:

StateError – if the object has already been closed

property start_style: LineEnding

The starting point’s style

Returns:

pdftools_toolbox.pdf.annotations.line_ending.LineEnding

Raises:

StateError – if the object has already been closed

property end_style: LineEnding

The ending point’s style

Returns:

pdftools_toolbox.pdf.annotations.line_ending.LineEnding

Raises:

StateError – if the object has already been closed

property line_ending_fill: Paint

The line ending filling paint

This paint applies to both the starting end the ending point.

Returns:

pdftools_toolbox.pdf.content.paint.Paint

Raises:

StateError – if the object has already been closed