SetStructElemScopeA
PDF có gắn thẻ, Khả năng tiếp cận
Mô tả
Ký tự A ở cuối biểu thị điểm vào DLL ANSI (char); bề mặt ActiveX/COM chỉ cung cấp dạng Unicode. Hành vi giống hệt với SetStructElemScope và các đối số chuỗi được diễn giải theo trang mã SetAnsiMode hiện tại
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.
Cú pháp
Delphi
Function DLSetStructElemScopeA(InstanceID: Integer; Scope: PAnsiChar): Integer;
DLL
int DLSetStructElemScopeA(int InstanceID, const char * Scope);
Tham số
| Scope | The 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 |
|---|
Giá trị trả về
Trả về 1 khi thành công. Trả về 0 nếu không có tài liệu nào đang mở hoặc tag stack hiện không còn tag nào đang mở
Ghi chú
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.
Ví dụ
// 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;Xem thêm
AddTagAttribute, SetStructElemBBox, BeginTag, EndTag, SetPDFUAMode