SetMarkInfo
Document properties, Accessibility
Description
在 Catalog 中设置文档的 /MarkInfo 字典;当 Marked 为 1 时,Catalog 将获得一个 /MarkInfo << /Marked true /Suspects false >> 条目,声明文档为标记的 PDF;当 Marked 为 0 时,/MarkInfo 条目将被移除
此函数在 a-符合性级别(PDF/A-1a,PDF/A-2a,PDF/A-3a)上由 SetPDFUAMode 和 SetPDFAMode 自动调用;仅在需要标记 PDF 状态而不需要完整的 PDF/UA-1 或 PDF/A-A 设置时,才直接调用它
Syntax
Delphi
Function TPDFlib.SetMarkInfo(Marked: Integer): Integer;
ActiveX
Function PDFlib::SetMarkInfo(Marked As Long) As Long
DLL
int DLSetMarkInfo(int InstanceID, int Marked);
Parameters
| Marked | 1 表示声明文档已标记(写入 /Marked true 和 /Suspects false);0 表示移除 /MarkInfo 条目 |
|---|
Return values
| 1 | /MarkInfo 条目已成功更新 |
|---|
Remarks
ISO 14289-1 (PDF/UA-1) §7.18.6 要求当 /Marked 为 true 时,必须存在 /Suspects 且设置为 false;本库在写入 /Marked true 的同时始终会写入 /Suspects false,因此只需调用一次 SetMarkInfo(1) 即可同时满足这两个要求
设置 /Marked true 仅为声明性语句 — 它本身*并不能*填充文档的结构树;调用 SetMarkInfo(1) 之后,请使用 BeginTag/EndTag 对构建结构树,并使用 BeginArtifact/EndArtifact 标记装饰性内容;请在保存前使用 GetPDFUADiagnostics 发现常见的缺失项
已加载文档上 /MarkInfo 之前的状态可以通过 IsTaggedPDF 进行查询
Example
// Convert a non-tagged loaded document into a tagged one, then add structure
PDF.LoadFromFile('source.pdf', '');
if PDF.IsTaggedPDF = 0 then
begin
PDF.SetMarkInfo(1);
// Re-open page 1 for editing
PDF.SelectPage(1);
PDF.BeginPageUpdate;
PDF.BeginTag('H1', '', '');
PDF.PrintText(50, 750, 'Document Title');
PDF.EndTag;
PDF.EndPageUpdate;
end;
PDF.SaveToFile('tagged.pdf');See also
IsTaggedPDF, SetPDFUAMode, SetPDFAMode, BeginTag, GetPDFUADiagnostics