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
| Name | Type | Access | Description |
|---|---|---|---|
Type | string | Read | Gets the type. |
StandardType | string | Read | Gets the standard type. |
IsStandardType | boolean | Read | Gets the is standard type. |
Parent | StructElement | undefined | Read | Gets the parent. |
Children | StructElement[] | Read | Gets the children. |
Title | string | undefined | Read/Write | Gets the title. |
Alt | string | undefined | Read/Write | Gets the alt. |
ActualText | string | undefined | Read/Write | Gets the actual text. |
Expansion | string | undefined | Read/Write | Gets the expansion. |
ID | string | undefined | Read/Write | Gets the id. |
Lang | string | undefined | Read/Write | Gets the lang. |
EffectiveLang | string | undefined | Read | Gets the effective lang. |
Page | Page | undefined | Read | Gets the page. |
Attributes | { A: PdfObject[]; C: PdfObject[] } | Read | Gets the attributes. |
A | : PdfObject[] | Read | Gets the a. |
C | : PdfObject[] | Read | Gets the c. |
ContentItems | ContentItem[] | Read | Gets the content items. |
Nodes | StructNode[] | Read | Gets the nodes. |
g | : GlyphEvent | Read | Gets the g. |
at | : number | Read | Gets the at. |
TableAttributes | TableAttributes | undefined | Read | Gets the table attributes. |
ListAttributes | ListAttributes | undefined | Read | Gets the list attributes. |
LayoutAttributes | LayoutAttributes | undefined | Read | Gets the layout attributes. |
Methods
| Signature | Description |
|---|---|
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) → string | This element’s text and its descendants’, in /K (reading) order. |
GetBBox(page: Page) → [number, number, number, number] | undefined | Union 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) → StructElement | Create a child structure element of type under this one; returns its handle. |
NextMcid(page: Page) → number | Allocate the next MCID for page against this element and wire the /ParentTree + /K. |
MarkContent(page: Page, region: Rect) → number | Tag 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. |