SetStructElemExpansionA
Tagged PDF & Accessibility
Popis
Koncové A označuje vstupní bod ANSI (char) knihovny DLL; rozhraní ActiveX/COM zpřístupňuje pouze formu Unicode. Chování je shodné s SetStructElemExpansion a řetězcové argumenty jsou interpretovány pomocí aktuální znakové stránky nastavené funkcí SetAnsiMode
Sets the /E (expansion text) entry on the structure element currently being built on the tag stack. The expansion text is the fully spelled-out form of an abbreviation or acronym contained in the element — for example World Wide Web for a Span element whose content reads WWW, or International Organization for Standardization for a Span containing ISO.
Čtečky obrazovky a další asistivní technologie přečtou rozvinutý text namísto pokusu vyslovit zkrácené znaky, což je nezbytné u zkratek, které se nedají vyslovovat jako slova
Syntaxe
Delphi
Function DLSetStructElemExpansionA(InstanceID: Integer; Expansion: PAnsiChar): Integer;
DLL
int DLSetStructElemExpansionA(int InstanceID, const char * Expansion);
Parametry
| Expansion | Plně rozvinutý text zkratky nebo akronymu v aktuálním strukturálním 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 zavolejte ihned po BeginTag, dokud je cílový prvek na vrcholu zásobníku tagů, případně kdykoli před odpovídajícím voláním EndTag
The /E entry is defined in ISO 32000-1 §14.9.5. It is written as a PDF text string in the structure element dictionary and is distinct from the other text properties:
- /E (Expansion) — Rozvinutá podoba zkratky nebo akronymu. Používá se pro výslovnost zkráceného řádkového obsahu čtečkou obrazovky
- /Alt (see SetStructElemAltText) — A complete substitute description for elements that cannot be rendered visually (images, figures, formulas).
- /ActualText (see SetStructElemActualText) — An exact Unicode replacement for glyph sequences whose extracted text would otherwise be incorrect (ligatures, glyph variants).
PDF/UA-1 (ISO 14289-1 §7.2) requires that the natural language of every piece of text be unambiguously determinable. For abbreviations and acronyms where the abbreviated form cannot be read aloud as a word, /E is the standard mechanism to provide that information.
Apply /E on the innermost element that wraps the abbreviation — typically a Span element. The expansion applies only to the content of that element and is not inherited by children.
Příklad
// Tag an abbreviation with its expansion
PDFlib.BeginTag('Span', '', '');
PDFlib.SetStructElemExpansion('World Wide Web');
PDFlib.WriteText('WWW');
PDFlib.EndTag;
// Tag a standards acronym
PDFlib.BeginTag('Span', '', '');
PDFlib.SetStructElemExpansion('International Organization for Standardization');
PDFlib.WriteText('ISO');
PDFlib.EndTag;Viz také
BeginTag, SetStructElemAltText, SetStructElemActualText, SetStructElemLang, GetPDFUADiagnostics