TaggedContent

Overview

TaggedContent is a class in Aspose.PDF FOSS for Python.

Editable view of a document’s logical structure tree.

This class provides 6 methods for working with TaggedContent objects in Python programs. Available methods include: __init__, add_element, element_for_mcid, move, remove, set_reading_order. All public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package. Properties: root_elements.

Properties

NameTypeAccessDescription
root_elementslist[StructureElement]ReadReturn top-level elements in logical reading order.

Methods

SignatureDescription
__init__(document: Document)Calls init(document) on this TaggedContent instance.
add_element(structure_type: str, parent: StructureElement | None, index: int | None, page_number: int | None, mcids: Iterable[int], alt_text: str | None, actual_text: str | None)StructureElementCreate and attach a structure element.
move(element: StructureElement, parent: StructureElement | None, index: int | None)Move an element to a parent and reading-order position.
set_reading_order(elements: Sequence[StructureElement], parent: StructureElement | None)Set the complete order of a parent’s direct structure children.
remove(element: StructureElement)Remove an element, its descendants, and their ParentTree mappings.
element_for_mcid(page_number: int, mcid: int)StructureElement | NoneReturn the structure element mapped to a page MCID, if any.

See Also