SpanElement
Overview
SpanElement is a class in Aspose.PDF FOSS for .NET.
Inherits from: StructureElement.
SpanElement methods such as AppendChild, SetTag, SetText, SetId, AdjustPosition, and ChangeParentElement let developers build and manipulate structured PDF content.
This class provides 11 methods for working with SpanElement objects in .NET programs.
Available methods include: AdjustPosition, AppendChild, ChangeParentElement, ClearId, Detach, FindElements, RemoveAndMoveItsChildObjectsToItsParent, SetId, SetTag, SetText, ToString.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: ActualText, AlternativeText, Attributes, ChildElements, ExpansionText, ID, and 6 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
StructureTextState | StructureTextState | Read | Text-state applied to this element’s inline content (stored only — the structure builder doesn’t re-render through it). |
Attributes | StructureElementAttributes | Read | The structure attributes (/A) attached to this element, organised by owner. |
StructureType | string | Read | The PDF structure-type role (/S entry, e.g. |
ActualText | string | Read/Write | The replacement text for the marked content (/ActualText). |
AlternativeText | string | Read/Write | Alternate text used by assistive technology (/Alt). |
ExpansionText | string | Read/Write | Expansion text for an abbreviation (/E). |
Language | string | Read/Write | BCP-47 language code for the element’s content (/Lang). |
ID | string | Read | Element identifier (/ID); read-only — assigned at save. |
Title | string | Read/Write | Title of the structure element (/T). |
Page | Page? | Read | Page hosting this element’s content, or null when the element hasn’t been attached to a page yet. |
ParentElement | StructureElement? | Read | The parent structure element, or null when this element is detached or directly under the structure-tree root. |
ChildElements | ElementList | Read | Direct children of this element. |
Methods
| Signature | Description |
|---|---|
AppendChild(child: StructureElement) | Append child under this element’s /K array. |
SetTag(tag: string) | Remap this element’s role to a custom tag, registering tag → its standard type in the document role map. |
ToString() | Textual representation used when dumping the structure tree (role name; falls back to the type name). |
FindElements(recursive: bool) | Recursively find descendant elements of type T. |
SetText(text: string) | Set the element’s text content (stored as ActualText). |
SetId(id: string) | Set the element identifier (/ID). |
ClearId() | Remove the element identifier (/ID). |
AdjustPosition(settings: object) | Stub no-op kept for compat with the AdjustPosition authoring API — FOSS doesn’t render through PositionSettings yet. |
ChangeParentElement(newParent: StructureElement, validate: bool) | Move this element under newParent. |
RemoveAndMoveItsChildObjectsToItsParent(validate: bool) | Detach this element, then re-parent its children under this element’s former parent (taking this element’s slot). |
Detach() | Detach this element from its parent. |