PDFiumVCL 文件

IsTagged property

此 API 條目保留識別符號、簽名、程式碼塊和 PDF 術語的原始形式。
Component: TPdf  ·  Unit: PDFium
Whether the document declares a structure tree for accessibility.

Syntax

property IsTagged: Boolean; // read only

Description

IsTagged returns True when the document catalog references a /StructTreeRoot — the root of the PDF logical structure tree (PDF 1.7 spec section 14.7). Tagged PDFs encode the document’s reading order, heading levels, table structure, lists, alt-text on images, and other semantic markup that screen readers, reflow engines, and content extractors rely on. PDF/UA-1 and PDF/A-2a/3a conformance both require tagged PDF.

The property is False when Active is False, when no structure tree is declared, or when the structure tree is present but empty. Many PDFs in the wild are not tagged — especially scanned documents, print-driver output, and tool exports from before 2010. Tagged-PDF support in authoring tools is improving but still uneven.

IsTagged is a cheap header check, suitable for routing decisions: skip structure-tree extraction on untagged files (it will simply return empty arrays), or surface an accessibility warning to the operator. The detailed tree is available through StructureElements, which materialises the tree into a flat array of TPdfStructureElement records with level, parent index, type name and role.

Remarks

Example

if not Pdf1.IsTagged then
  Log.Add('Warning: PDF is not tagged. Screen-reader output will be unreliable.');
if Pdf1.IsTagged and (Pdf1.Language = '') then
  Log.Add('Tagged PDF without /Lang - fails PDF/UA.');

See Also

StructureElements, Language, FormType