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

NameTypeAccessDescription
StructureTextStateStructureTextStateReadText-state applied to this element’s inline content (stored only — the structure builder doesn’t re-render through it).
AttributesStructureElementAttributesReadThe structure attributes (/A) attached to this element, organised by owner.
StructureTypestringReadThe PDF structure-type role (/S entry, e.g.
ActualTextstringRead/WriteThe replacement text for the marked content (/ActualText).
AlternativeTextstringRead/WriteAlternate text used by assistive technology (/Alt).
ExpansionTextstringRead/WriteExpansion text for an abbreviation (/E).
LanguagestringRead/WriteBCP-47 language code for the element’s content (/Lang).
IDstringReadElement identifier (/ID); read-only — assigned at save.
TitlestringRead/WriteTitle of the structure element (/T).
PagePage?ReadPage hosting this element’s content, or null when the element hasn’t been attached to a page yet.
ParentElementStructureElement?ReadThe parent structure element, or null when this element is detached or directly under the structure-tree root.
ChildElementsElementListReadDirect children of this element.

Methods

SignatureDescription
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.

See Also