BeginArtifactExA
标记 PDF、可访问性
描述
末尾的 A 表示 ANSI(char)DLL 入口点;ActiveX/COM 接口仅公开 Unicode 形式,行为与 BeginArtifactEx 相同,字符串参数按当前 SetAnsiMode 代码页解释
以单个调用开启具有明确工件类型和可选 Pagination 子类型的 PDF 工件标记内容序列,扩展 BeginArtifact 以支持 ISO 32000-1 §14.8.2.2.1 Table 330 定义的完整工件属性字典
当需要在单个运算符中同时表达工件类型(Pagination、Layout 或 Page)和 Pagination 子类型(Header、Footer、Watermark、PageNum 或 LineNum)时,使用此函数。若只需要一个维度,BeginArtifact 即可满足要求
每次 BeginArtifactEx 调用后都必须有匹配的 EndArtifact 调用
语法
Delphi
Function DLBeginArtifactExA(InstanceID: Integer; ArtifactType, ArtifactSubtype: PAnsiChar): Integer;
DLL
int DLBeginArtifactExA(int InstanceID, const char * ArtifactType, const char * ArtifactSubtype);
参数
| ArtifactType | 作为 /Type 属性写入的 Artifact 类型名称 根据 ISO 32000-1 §14.8.2.2.1,有效值为:
/Type(运算符将回退为仅使用 /Subtype,或使用裸 /Artifact BMC) |
|---|---|
| ArtifactSubtype | 作为 /Subtype 属性写入的分页子类型,仅当 ArtifactType 为 Pagination 时才有意义,常用值包括:Header、Footer、Watermark、PageNum、LineNum,传入空字符串可省略 /Subtype |
已写入运算符
| Both non-empty | /Artifact << /Type /T /Subtype /S >> BMC |
|---|---|
| Type only | /Artifact << /Type /T >> BMC |
| Subtype only | /Artifact << /Subtype /S >> BMC |
| Both empty | /Artifact BMC |
返回值
| 0 | 失败(未打开文档) |
|---|---|
| 1 | Artifact 序列已成功打开 |
示例
// Mark a running header as a Pagination artifact with subtype Header
PDF.BeginArtifactEx('Pagination', 'Header');
PDF.PrintText(50, 780, 'Chapter 3 — Results');
PDF.EndArtifact;
// Mark a column rule as a Layout artifact (no subtype needed)
PDF.BeginArtifactEx('Layout', '');
PDF.DrawLine(300, 50, 300, 750);
PDF.EndArtifact;