StructElement

Overview

StructElement is a class in Aspose.PDF FOSS for TypeScript.

A node in the structure tree: a live handle over its real /StructElem dict.

This class declares 10 methods for StructElement objects in TypeScript programs. Available methods include: AddAnnotation, Append, GetBBox, GetText, MarkContent, NextMcid, SetLayoutAttributes, SetListAttributes, SetTableAttributes, constructor. All public members are accessible to any TypeScript application after installing the Aspose.PDF FOSS for TypeScript package. Properties: A, ActualText, Alt, Attributes, C, Children, and 17 more.

Properties

NameTypeAccessDescription
TypestringReadGets the type.
StandardTypestringReadGets the standard type.
IsStandardTypebooleanReadGets the is standard type.
ParentStructElement | undefinedReadGets the parent.
ChildrenStructElement[]ReadGets the children.
Titlestring | undefinedRead/WriteGets the title.
Altstring | undefinedRead/WriteGets the alt.
ActualTextstring | undefinedRead/WriteGets the actual text.
Expansionstring | undefinedRead/WriteGets the expansion.
IDstring | undefinedRead/WriteGets the id.
Langstring | undefinedRead/WriteGets the lang.
EffectiveLangstring | undefinedReadGets the effective lang.
PagePage | undefinedReadGets the page.
Attributes{ A: PdfObject[]; C: PdfObject[] }ReadGets the attributes.
A: PdfObject[]ReadGets the a.
C: PdfObject[]ReadGets the c.
ContentItemsContentItem[]ReadGets the content items.
NodesStructNode[]ReadGets the nodes.
g: GlyphEventReadGets the g.
at: numberReadGets the at.
TableAttributesTableAttributes | undefinedReadGets the table attributes.
ListAttributesListAttributes | undefinedReadGets the list attributes.
LayoutAttributesLayoutAttributes | undefinedReadGets the layout attributes.

Methods

SignatureDescription
constructor(doc: Document, Dict: PdfDict, Ref: PdfRef | undefined, Root: StructTreeRoot)Calls constructor(doc, Dict, Ref, Root) on this StructElement instance.
GetText(skip: (e: StructElement) => boolean)stringThis element’s text and its descendants’, in /K (reading) order.
GetBBox(page: Page)[number, number, number, number] | undefinedUnion of the page-space quads of every glyph behind this element’s marked content (recursing into descendant elements), or undefined when it contributes no glyphs.
Append(type: string, opts: ElemOpts)StructElementCreate a child structure element of type under this one; returns its handle.
NextMcid(page: Page)numberAllocate the next MCID for page against this element and wire the /ParentTree + /K.
MarkContent(page: Page, region: Rect)numberTag existing page content under this element: allocate an MCID and wrap the top-level show/Do ops whose content falls in region in /<Type> <</MCID n>> BDC … EMC.
AddAnnotation(annotation: Annotation)Tag an annotation (e.g.
SetTableAttributes(attrs: Partial<TableAttributes>)Merge table attributes into this element’s /A (a field set to undefined deletes that key).
SetListAttributes(attrs: Partial<ListAttributes>)Merge list attributes into this element’s /A.
SetLayoutAttributes(attrs: Partial<LayoutAttributes>)Merge layout attributes into this element’s /A.