GetStructTreeItemText

Tagged PDF, Content Extraction

Description

Returns a text property of one structure tree snapshot item.

Syntax

Delphi

Function TPDFlib.GetStructTreeItemText(Index, InfoID: Integer): WideString;

Parameters

Index1-based item index from the most recent StructTreeItemCount call.
InfoID1 the raw structure type (/S); 2 the type resolved through the /RoleMap chain; 3 the title (/T); 4 the alternate description (/Alt); 5 the replacement text (/ActualText); 6 the language (/Lang); 7 the element identifier (/ID); 8 the abbreviation expansion (/E).

Return values

''The index is out of range or the entry is absent.
TextThe requested property value.

Remarks

InfoID 2 follows custom-to-standard role mappings for up to 32 hops, so documents that tag content with custom types still report the standard structure type they map to.

Example

if PDF.GetStructTreeItemText(I, 2)= 'Figure' then
  Alt:= PDF.GetStructTreeItemText(I, 4); // alternate description

See also

StructTreeItemCount, GetStructTreeItemIntProperty, AddRoleMap