StructElement
StructElement
Przegląd
StructElement jest klasą w Aspose.PDF FOSS dla TypeScript.
Węzeł w drzewie struktury: aktywne odwołanie do jego rzeczywistego słownika /StructElem.
Ta klasa deklaruje 10 metod dla obiektów StructElement w programach TypeScript. Dostępne metody to: AddAnnotation, Append, GetBBox, GetText, MarkContent, NextMcid, SetLayoutAttributes, SetListAttributes, SetTableAttributes, constructor. Wszystkie publiczne elementy są dostępne dla każdej aplikacji TypeScript po zainstalowaniu pakietu Aspose.PDF FOSS dla TypeScript. Właściwości: A, ActualText, Alt, Attributes, C, Children oraz 17 kolejnych.
Właściwości
| Nazwa | Typ | Dostęp | Opis |
|---|---|---|---|
Type | string | Odczyt | Pobiera typ. |
StandardType | string | Odczyt | Pobiera standardowy typ. |
IsStandardType | boolean | Odczyt | Pobiera standardowy typ. |
Parent | `StructElement | undefined` | Odczyt |
Children | StructElement[] | Odczyt | Zwraca dzieci. |
Title | `string | undefined` | Odczyt/zapis |
Alt | `string | undefined` | Odczyt/zapis |
ActualText | `string | undefined` | Odczyt/zapis |
Expansion | `string | undefined` | Odczyt/zapis |
ID | `string | undefined` | Odczyt/zapis |
Lang | `string | undefined` | Odczyt/zapis |
EffectiveLang | `string | undefined` | Odczyt |
Page | `Page | undefined` | Odczyt |
Attributes | { A: PdfObject[]; C: PdfObject[] } | Odczyt | Pobiera atrybuty. |
A | : PdfObject[] | Odczyt | Pobiera a. |
C | : PdfObject[] | Odczyt | Pobiera c. |
ContentItems | ContentItem[] | Odczyt | Pobiera elementy treści. |
Nodes | StructNode[] | Odczyt | Pobiera węzły. |
g | : GlyphEvent | Odczyt | Pobiera g. |
at | : number | Odczyt | Pobiera at. |
TableAttributes | `TableAttributes | undefined` | Odczyt |
ListAttributes | `ListAttributes | undefined` | Odczyt |
LayoutAttributes | `LayoutAttributes | undefined` | Odczyt |
Metody
| Sygnatura | Opis |
|---|---|
| `constructor(doc: Document, Dict: PdfDict, Ref: PdfRef | undefined, Root: StructTreeRoot)` |
GetText(skip: (e: StructElement) => boolean) → string | Tekst tego elementu oraz jego potomków, w kolejności /K (odczytu). |
GetBBox(page: Page) → `[number, number, number, number] | undefined` |
Append(type: string, opts: ElemOpts) → StructElement | Utwórz element struktury potomny type pod tym; zwraca jego uchwyt. |
NextMcid(page: Page) → number | Przydziel kolejny MCID dla page względem tego elementu i podłącz /ParentTree + /K. |
MarkContent(page: Page, region: Rect) → number | Otaguj istniejącą treść strony pod tym elementem: przydziel MCID i otocz operacje top-level show/Do, których treść mieści się w region, w /<Type> <</MCID n>> BDC … EMC. |
AddAnnotation(annotation: Annotation) | Otaguj adnotację (np. |
SetTableAttributes(attrs: Partial<TableAttributes>) | Scalisz atrybuty tabeli do /A tego elementu (pole ustawione na undefined usuwa ten klucz). |
SetListAttributes(attrs: Partial<ListAttributes>) | Scalisz atrybuty listy do /A tego elementu. |
SetLayoutAttributes(attrs: Partial<LayoutAttributes>) | Scalisz atrybuty układu do /A tego elementu. |