StructureElement
Overview
StructureElement is a class in Aspose.PDF FOSS for Python.
A mutable logical-structure element in a tagged PDF.
This class provides 5 methods for working with StructureElement objects in Python programs.
Available methods include: __init__, add_child, move_to, remove, set_reading_order.
All public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package.
Properties: actual_text, alt_text, children, mcids, page_number, parent, and 1 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
structure_type | str | Read/Write | Get or set the element’s structure type, such as P or Figure. |
alt_text | str | None | Read/Write | Get or set the /Alt alternate description. |
actual_text | str | None | Read/Write | Get or set the /ActualText replacement text. |
page_number | int | None | Read | Return the one-based page number referenced by /Pg. |
mcids | tuple[int, ...] | Read | Return direct marked-content IDs referenced by this element. |
parent | StructureElement | None | Read | Return the parent element, or None for a top-level element. |
children | list[StructureElement] | Read | Return direct child elements in logical reading order. |
Methods
| Signature | Description |
|---|---|
__init__(content: TaggedContent, element: Any) | Calls init(content, element) on this StructureElement instance. |
add_child(structure_type: str, index: int | None, page_number: int | None, mcids: Iterable[int], alt_text: str | None, actual_text: str | None) → StructureElement | Create a direct child element. |
move_to(parent: StructureElement | None, index: int | None) | Move this element to a parent and reading-order position. |
set_reading_order(elements: Sequence[StructureElement]) | Set the complete order of this element’s direct children. |
remove() | Remove this element and its descendants from the structure tree. |