BeginTagEx
Tagged PDF, Přístupnost
Popis
Otevře na aktuální stránce prvek struktury tagovaného PDF s explicitním atributem v přirozeném jazyce. Je shodná s BeginTag, ale přidává parametr Lang, který se zapíše do atributu /Lang prvku struktury
Use this function for content whose language differs from the document's default language (set by SetPDFUAMode or SetDocumentLanguage). ISO 14289-1 §7.2 requires the /Lang attribute to be set on any text segment that is not in the document's primary language.
Tagy musí být vyvážené: každé volání BeginTagEx musí následovat odpovídající volání EndTag. Tagy lze zanořovat
Syntaxe
Delphi
Function TPDFlib.BeginTagEx(Const TagType, AltText, ActualText, Lang: WideString): Integer;
ActiveX
Function PDFlib::BeginTagEx(TagType As String, AltText As String, ActualText As String, Lang As String) As Long
DLL
int DLBeginTagEx(int InstanceID, const wchar_t * TagType, const wchar_t * AltText, const wchar_t * ActualText, const wchar_t * Lang);
Parametry
| TagType | PDF standard structure type: P, H1–H6, Figure, Table, TR, TH, TD, L, LI, LBody, Span, Link, Note, etc. (see ISO 32000-1 §14.8.4). |
|---|---|
| AltText | Alternative text for images and other non-text content (/Alt attribute). Pass an empty string if not required. |
| ActualText | Replacement text for content whose visual form differs from its logical meaning (/ActualText attribute). Pass an empty string if not required. |
| Lang | Jazykový tag BCP 47 pro obsah tohoto prvku, například en-US, fr-FR, zh-Hans. Prázdný řetězec znamená dědění jazyka dokumentu. Je-li neprázdný, přebíjí jazyk na úrovni dokumentu pro tento prvek i všechny jeho potomky |
Návratové hodnoty
| 0 | Failed (no document is open) |
|---|---|
| 1 | Tag opened successfully |
Příklad
// Document in English with a French citation
PDF.SetPDFUAMode('en-US');
PDF.BeginTag('P', '', '');
PDF.PrintText(50, 750, 'The French motto is:');
PDF.EndTag;
PDF.BeginTagEx('Span', '', '', 'fr-FR');
PDF.PrintText(50, 730, 'Liberté, Égalité, Fraternité');
PDF.EndTag;