SetStructElemActualText
Tagged PDF & Accessibility
Popis
Nastaví položku /ActualText na strukturálním prvku, který se právě sestavuje na vrcholu zásobníku tagů. ActualText podává přesný text Unicode, který prvek představuje, a přebíjí tak jakýkoli text extrahovaný z PDF obsahového streamu softwarem čtečky
Use this function when the glyphs rendered in the content stream do not directly map to their intended reading-order characters — for example, a ligature glyph (ff, fi, fl) that should read as the two-character sequence ff, fi, or fl. Without ActualText, text-extraction tools and screen readers may produce incorrect output for such glyphs.
Syntaxe
Delphi
Function TPDFlib.SetStructElemActualText(Const ActualText: WideString): Integer;
ActiveX
Function PDFlib::SetStructElemActualText(ActualText As String) As Long
DLL
int DLSetStructElemActualText(int InstanceID, const wchar_t * ActualText);
Parametry
| ActualText | Řetězec textu Unicode, který se má přiřadit aktuálnímu strukturálnímu prvku. Chcete-li vymazat dříve nastavenou hodnotu, předejte prázdný řetězec |
|---|
Návratová hodnota
Returns 1 on success, 0 if no structure element is currently open or no document is selected.
Poznámky
Tuto funkci volejte bezprostředně po BeginTag nebo BeginTagEx, když je cílový prvek na vrcholu zásobníku značek
ActualText a AltText slouží k různým účelům. AltText (nastavuje se parametrem AltText funkce BeginTag) je alternativní podoba celého prvku určená pro asistivní technologie, když vizuální obsah nelze zobrazit. ActualText doplňuje extrakci textu z obsahového streamu: nahrazuje extrahovanou posloupnost znaků prvku, ale nezastavuje vykreslování. Čtečky obrazovky podporující obojí typicky použijí pro hlasový výstup, je-li k dispozici, ActualText
ISO 32000-1 §14.9.4 defines ActualText as a PDF text string entry on the structure element dictionary. PDF/UA-1 (ISO 14289-1 §7.1) requires that text content be extractable and correct; ActualText is the standard mechanism to satisfy this requirement for glyph sequences whose direct extraction would be ambiguous or incorrect.
Příklad
// Tag a ligature glyph so that text extraction yields "fi"
PDFlib.BeginTag('Span', '', '');
PDFlib.SetStructElemActualText('fi');
PDFlib.TextOut(x, y, #$FB01); // U+FB01 LATIN SMALL LIGATURE FI
PDFlib.EndTag;Viz také
BeginTag, BeginTagEx, SetStructElemID, AddTagAttribute, GetPDFUADiagnostics