BeginArtifactEx
标记 PDF、无障碍
描述
通过一次调用打开带有显式 artifact 类型和可选 Pagination 子类型的 artifact 标记内容序列,使用 ISO 32000-2 §14.8.2.2.1 Table 363 要求的属性字典和 BDC 运算符请对
Pagination、Layout、Page 或 PDF 2.0 的 Background artifact 使用该函数;每次成功调用之后必须跟随对应的 EndArtifact 调用
语法
Delphi
Function TPDFlib.BeginArtifactEx(Const ArtifactType, ArtifactSubtype: WideString): Integer;
ActiveX
Function PDFlib::BeginArtifactEx(ArtifactType As String, ArtifactSubtype As String) As Long
DLL
int DLBeginArtifactEx(int InstanceID, const wchar_t * ArtifactType, const wchar_t * ArtifactSubtype);
参数
| ArtifactType | 传入 Pagination、Layout、Page 或 Background,或传入空字符串以省略 /Type |
|---|---|
| ArtifactSubtype | 可选的 Pagination 子类型,常见值为 Header、Footer、Watermark、PageNum、LineNum、Redaction 或 Bates |
写入的运算符
| 两者均非空 | /Artifact << /Type /T /Subtype /S >> BDC |
|---|---|
| 仅类型 | /Artifact << /Type /T >> BDC |
| 仅子类型 | /Artifact << /Subtype /S >> BDC |
| 两者均为空 | /Artifact BMC |
PDF 版本
Background、PageNum、LineNum、Redaction 和 Bates 需要 PDF 2.0,并会自动提升输出功能版本
返回值
| 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 page background using the PDF 2.0 artifact type
PDF.BeginArtifactEx('Background', '');
PDF.DrawImage(BackgroundImage, 0, 0, PDF.PageWidth, PDF.PageHeight);
PDF.EndArtifact;