pdf2docx.text.Spans module#

A group of TextSpan and ImageSpan objects.

class pdf2docx.text.Spans.Spans(instances: Optional[list] = None, parent=None)#

Bases: ElementCollection

Collection of TextSpan and ImageSpan instances.

property image_spans#

Get ImageSpan instances.

restore(raws: list)#

Recreate TextSpan or ImageSpan from source dict list.

strip()#

Remove redundant blanks at the begin/end span.

property text_spans#

Get TextSpan instances.