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 PdfStructureElementProperties
| Name | Description |
|---|---|
| ActualText | Gets or sets the replacement text (/ActualText): the text the content of the element shows, such as the letters of a drawn initial. |
| AlternateDescription | Gets or sets the alternate description (/Alt): the text that replaces a figure or a formula for the readers that cannot show it. |
| Children | Gets the child elements. |
| Dictionary | Gets the dictionary of the element. |
| Expansion | Gets or sets the expansion of an abbreviation or an acronym (/E). |
| Language | 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. |
| Title | Gets or sets the title of the element (/T). |
| Type | Gets the structure type (/S): a standard type such as P, H1 or Figure, or a type of the role map. |
ActualText
PdfStructureElement.csAlternateDescription
PdfStructureElement.csChildren
PdfStructureElement.csDictionary
PdfStructureElement.csExpansion
PdfStructureElement.csLanguage
PdfStructureElement.csMethods
| Name | Description |
|---|---|
| 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. |
| GetAttribute(string, string) | Gets an attribute of the element (/A, ISO 32000-2, 14.7.6): the value of an entry of the attribute object of an owner, such as the Scope of the Table owner. |
| SetAttribute(string, string, PdfObject?) | Sets an attribute of the element (/A, 14.7.6), in the attribute object of its owner, which is created when the element has none. |
AddAnnotation(PdfAnnotation)
PdfStructureElement.csAdds 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
annotationPdfAnnotation- The annotation.
Exceptions
ArgumentException- The annotation is not on a page of the document.
AddElement(string)
PdfStructureElement.csAdds a child element.
public PdfStructureElement AddElement(string type)Parameters
typestring- The structure type: a standard type such as
P,H1,FigureorTable, or a type ofPdfStructureTree.RoleMap.
Returns
PdfStructureElement The element.
GetAttribute(string, string)
PdfStructureElement.csGets an attribute of the element (/A, ISO 32000-2, 14.7.6): the value of an entry of the attribute object of an owner, such as the Scope of the Table owner.
Parameters
ownerstring- The owner of the attribute object (
/O):Layout,List,PrintField,Table, ... namestring- The name of the attribute.
Returns
PdfObject? The value, or null when the element has no such attribute.
SetAttribute(string, string, PdfObject?)
PdfStructureElement.csSets an attribute of the element (/A, 14.7.6), in the attribute object of its owner, which is created when the element has none.
Parameters
ownerstring- The owner of the attribute object (
/O):Layout,List,PrintField,Table, ... namestring- The name of the attribute, such as
Scope,RowSpanorBBox. valuePdfObject?- The value, or
nullto remove the attribute.