PdfStructureElement Class

An element of the structure tree of a tagged document (ISO 32000-2, 14.7.2): a paragraph, a heading, a figure, a table... Its content is the marked content the content builder tags with it (PdfContentBuilder.BeginStructureElement), its annotations and its child elements.

public sealed class PdfStructureElement

Properties

NameDescription
ActualTextGets or sets the replacement text (/ActualText): the text the content of the element shows, such as the letters of a drawn initial.
AlternateDescriptionGets or sets the alternate description (/Alt): the text that replaces a figure or a formula for the readers that cannot show it.
ChildrenGets the child elements.
DictionaryGets the dictionary of the element.
ExpansionGets or sets the expansion of an abbreviation or an acronym (/E).
LanguageGets or sets the language of the content of the element (/Lang), a BCP 47 tag such as en-US, when it is not the language of the document.
TitleGets or sets the title of the element (/T).
TypeGets the structure type (/S): a standard type such as P, H1 or Figure, or a type of the role map.

Gets or sets the replacement text (/ActualText): the text the content of the element shows, such as the letters of a drawn initial.

public string? ActualText { get; set; }

Property value

string?

AlternateDescription

PdfStructureElement.cs

Gets or sets the alternate description (/Alt): the text that replaces a figure or a formula for the readers that cannot show it.

public string? AlternateDescription { get; set; }

Property value

string?

Gets the child elements.

public IReadOnlyList<PdfStructureElement> Children { get; }

Gets the dictionary of the element.

public PdfDictionary Dictionary { get; }

Property value

PdfDictionary

Gets or sets the expansion of an abbreviation or an acronym (/E).

public string? Expansion { get; set; }

Property value

string?

Gets or sets the language of the content of the element (/Lang), a BCP 47 tag such as en-US, when it is not the language of the document.

public string? Language { get; set; }

Property value

string?

Gets or sets the title of the element (/T).

public string? Title { get; set; }

Property value

string?

Gets the structure type (/S): a standard type such as P, H1 or Figure, or a type of the role map.

public string Type { get; }

Property value

string

Methods

NameDescription
AddAnnotation(PdfAnnotation)Adds an annotation of a page to the content of the element (an object reference, 14.7.5.3): a link of the text of the element, for instance.
AddElement(string)Adds a child element.

AddAnnotation(PdfAnnotation)

PdfStructureElement.cs

Adds an annotation of a page to the content of the element (an object reference, 14.7.5.3): a link of the text of the element, for instance.

public void AddAnnotation(PdfAnnotation annotation)

Parameters

annotation PdfAnnotation
The annotation.

Exceptions

ArgumentException
The annotation is not on a page of the document.

AddElement(string)

PdfStructureElement.cs

Adds a child element.

public PdfStructureElement AddElement(string type)

Parameters

type string
The structure type: a standard type such as P, H1, Figure or Table, or a type of PdfStructureTree.RoleMap.

Returns

PdfStructureElement The element.