SetStructElemScopeA

標籤式 PDF、無障礙

Description

結尾的 A 表示 ANSI(char)DLL 進入點,ActiveX/COM 介面僅公開 Unicode 形式。其行為與 SetStructElemScope 相同,字串引數會依據目前的 SetAnsiMode 字碼頁進行解譯

Sets the /Scope attribute (Table attribute owner) on the structure element currently open on the tag stack. The scope identifies whether a TH (table header) cell applies to a column, a row, or both — required by PDF/UA-1 for tables with header cells. Equivalent to calling AddTagAttribute with Owner=Table, Name=Scope, and the scope name as the value.

語法

Delphi

Function DLSetStructElemScopeA(InstanceID: Integer; Scope: PAnsiChar): Integer;

DLL

int DLSetStructElemScopeA(int InstanceID, const char * Scope);

參數

ScopeThe scope of the header cell. Must be one of the following values (case-sensitive):

Column — the header applies to all cells in the column
Row — the header applies to all cells in the row
Both — the header applies to both the column and the row

Return value

成功傳回 1。沒有開啟的文件,或標籤堆疊上沒有開啟中的標籤時傳回 0

Remarks

Call this function after BeginTag (with tag type TH) and before EndTag. The /Scope attribute is defined in ISO 32000-1 §14.8.5.7.2 (Table attribute owner).

PDF/UA-1 (ISO 14289-1 §7.10) requires that table header cells clearly associate with their data cells. Providing the /Scope attribute is the recommended mechanism when the table layout allows it.

範例

// Tag a column header cell
PDFlib.BeginTag('TH', 'Product Name', '', '');
PDFlib.SetStructElemScope('Column');
PDFlib.DrawText('Product Name', 100, 700);
PDFlib.EndTag;

// Tag a row header cell
PDFlib.BeginTag('TH', 'Row 1', '', '');
PDFlib.SetStructElemScope('Row');
PDFlib.DrawText('Row 1', 72, 680);
PDFlib.EndTag;

另見

AddTagAttribute, SetStructElemBBox, BeginTag, EndTag, SetPDFUAMode