SetStructElemAltTextA
Tagged PDF & Accessibility
Opis
Sufiks A na kraju označava ulaznu tačku DLL-a tipa ANSI (char); sučelje ActiveX/COM izlaže samo Unicode oblik. Ponašanje je identično sa SetStructElemAltText, a string argumenti se tumače pomoću trenutne kodne stranice SetAnsiMode
Sets the /Alt entry on the structure element currently being built on the tag stack. Alternative text is the text description that assistive technology (screen readers, braille displays) presents to users when the element cannot be rendered visually — for example, an image, figure, or mathematical formula.
Ova funkcija je istovetna prosleđivanju nepraznog argumenta AltText funkciji BeginTag ili BeginTagEx, ali omogućava da se alternativni tekst postavi ili ažurira nakon otvaranja elementa. Korisna je kad se opis računa ili dohvata asinhrono, nakon što je tip elementa poznat
Sintaksa
Delphi
Function DLSetStructElemAltTextA(InstanceID: Integer; AltText: PAnsiChar): Integer;
DLL
int DLSetStructElemAltTextA(int InstanceID, const char * AltText);
Parametri
| AltText | Opis alternativnog teksta koji se vezuje za trenutni strukturni element. Prosledite prazan string da obrišete ranije postavljenu vrednost |
|---|
Povratna vrednost
Vraća 1 pri uspehu, 0 ako trenutno nije otvoren nijedan strukturni element ili nije izabran dokument
Napomene
Pozovite ovu funkciju odmah nakon BeginTag, dok je ciljni element na vrhu steka tagova, ili bilo kada pre odgovarajućeg poziva EndTag
AltText and ActualText serve different purposes. AltText is a complete textual substitute for the entire element — it replaces the visual content for users who cannot perceive the rendered output. ActualText (ISO 32000-1 §14.9.4) provides the exact Unicode character sequence for inline glyphs whose extracted text would otherwise be incorrect (such as ligatures), and does not replace rendering. Screen readers typically speak AltText for Figure and Formula elements, and use ActualText for character-level corrections.
ISO 32000-1 §14.9.3 defines the /Alt entry. PDF/UA-1 (ISO 14289-1 §7.5) requires alternative descriptions on Figure and Formula structure elements. GetPDFUADiagnostics reports the FIGURE-NO-ALT:N issue code when Figure or Formula elements are missing Alt text.
Primer
// Tag an embedded chart image with alternative text
PDFlib.BeginTag('Figure', '', '');
PDFlib.SetStructElemAltText('Bar chart: Q1 sales 120, Q2 sales 145, Q3 sales 98');
PDFlib.SetStructElemBBox(x, y, x + w, y + h);
PDFlib.DrawImage(imgHandle, x, y, w, h);
PDFlib.EndTag;See also
BeginTag, BeginTagEx, SetStructElemActualText, SetStructElemLang, GetPDFUADiagnostics