SetStructElemAltTextA

Tagged PDF & Accessibility

תיאור

ה-A הסופי מציין את נקודת הכניסה של ANSI (char) ב-DLL; משטח ה-ActiveX/COM חושף רק את הצורה Unicode. ההתנהגות זהה ל-SetStructElemAltText וארגומנטי מחרוזת מפורשים באמצעות דף הקוד הנוכחי של 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.

הפונקציה שווה ערך להעברת ארגומנט AltText לא ריק ל-BeginTag או ל-BeginTagEx, אך מאפשרת להגדיר או לעדכן את הטקסט החלופי אחרי שהאלמנט נפתח. זה שימושי כשאת התיאור מחשבים או שולפים אסינכרונית אחרי שסוג האלמנט ידוע

תחביר

Delphi

Function DLSetStructElemAltTextA(InstanceID: Integer; AltText: PAnsiChar): Integer;

DLL

int DLSetStructElemAltTextA(int InstanceID, const char * AltText);

פרמטרים

AltTextThe alternative text description to associate with the current structure element. Pass an empty string to clear a previously set value.

ערך מוחזר

Returns 1 on success, 0 if no structure element is currently open or no document is selected.

הערות

קראו לפונקציה זו מיד אחרי BeginTag בזמן שאלמנט היעד בראש מחסנית התגים, או בכל נקודה לפני הקריאה ל-EndTag התואם

AltText ו-ActualText משרתים מטרות שונות. AltText הוא תחליף טקסטואלי מלא לכל הרכיב — הוא מחליף את התוכן החזותי עבור משתמשים שאינם יכולים לתפוס את הפלט המרונדר. ActualText (ISO 32000-1 §14.9.4) מספק את רצף תווי ה-Unicode המדויק עבור גליפים בתוך השורה שהטקסט שחולץ שלהם היה שגוי אחרת, למשל ligatures, ואינו מחליף את הרינדור. קוראי מסך בדרך כלל מקריאים AltText עבור רכיבי Figure ו-Formula ומשתמשים ב-ActualText לתיקונים ברמת התו

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.

דוגמה

// 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;

ראו גם

BeginTag, BeginTagEx, SetStructElemActualText, SetStructElemLang, GetPDFUADiagnostics