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
| Name | Type | Access | Description |
|---|---|---|---|
root_elements | list[StructureElement] | Read | Return top-level elements in logical reading order. |
Methods
| Signature | Description |
|---|---|
__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) → StructureElement | Create 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 | None | Return the structure element mapped to a page MCID, if any. |