hotpdf.data.classes.Span

class hotpdf.data.classes.Span(characters: list[HotCharacter], span_id: UUID)

A span is a group of characters that are close to each other.

characters

list of characters in the span.

Type:

list[HotCharacter]

x0

starting x position of the span (column).

Type:

int

y0

starting y position of the span (row).

Type:

int

x_end

end x position of the span (column). x_end - x0 = width.

Type:

int

span_id

hash of the span.

Type:

UUID, Optional

__init__(characters: list[HotCharacter], span_id: UUID) None

Methods

__init__(characters, span_id)

get_element_dimension()

Get the element dimension of the span.

to_text()

Convert the span to text.

Attributes

characters

span_id