THotPDF.ValidatePDFUA2Structure Method
Runs bounded PDF/UA-2 structure validation over a producer or loaded object graph and returns stable structured diagnostics without mutating the document
Declaration
function ValidatePDFUA2Structure(
const Options: THPDFUA2ValidationOptions;
out Issues: THPDFUA2ValidationIssues): boolean; overload;
function ValidatePDFUA2Structure(
const Options: THPDFUA2ValidationOptions;
out Findings: THPDFComplianceFindings): boolean; overload;
Unit
HPDFDoc
Validation options
Use THPDFUA2ValidationOptions.Default for strict generation validation or adjust individual semantic policies for intake diagnostics
| Field | Purpose |
|---|---|
HeadingPolicy | Ignores, diagnoses or refuses skipped heading levels |
AllowDocumentFragmentHeadingStarts | Resets heading context inside DocumentFragment |
CheckDocumentSemantics | Checks Catalog language, metadata, displayed title, optional content and embedded files |
CheckHumanReadableStrings | Refuses Unicode private-use characters in human-readable strings |
CheckAnnotationSemantics | Checks page tab order, annotation ownership, roles, flags, descriptions and appearance streams |
CheckFormSemantics | Checks AcroForm fields, widgets, labels, actions, options and rich values |
CheckNavigationSemantics | Checks structure destinations, outlines and nested page-label number trees |
RequireListLabels | Requires one Lbl for each numbered list item |
RequireExplicitTableHeaderAssociations | Reports data cells that depend only on scope inference |
CheckListSemantics | Checks numbering, continuation chains, captions, labels, bodies and direct real-content placement |
CheckTableSemantics | Checks bounded grid geometry, row groups, spans, scopes and table-local header associations |
CheckRubyWarichuSequences | Checks the exact direct-child sequences required for Ruby and Warichu |
CheckPronunciationHints | Checks pronunciation entry types and indirect embedded PLS lexicons |
RequireStructureAssociatedFiles | Requires every catalogue associated file to be reachable from structure |
RequireFormulaTextAlternative | Requires Alt, ActualText or associated MathML for formulas |
MaxObjects | Bounds indirect-object scanning and defaults to 1,000,000 objects |
MaxIssues | Bounds retained diagnostics and defaults to 256 issues |
Return value
Returns True only when no uisError diagnostic remains
Diagnostics
THPDFUA2IssueSeverity distinguishes warnings and errors, whilst each THPDFUA2ValidationIssue carries a stable namespaced code, applicable clause, object path, object number, zero-based page index when known and human-readable message in the THPDFUA2ValidationIssues array
- Validation never creates a missing
StructTreeRootor namespace dictionary - Namespace-aware role maps are resolved transitively with cycle and depth detection
- Document metadata, human-readable strings, optional content, structure elements, parent backlinks, attributes, annotations, forms, navigation, associated files, headings, lists, tables, Ruby, Warichu, pronunciation hints, formulas and MathML are checked in one bounded pass
- Loaded annotation ownership is resolved from the physical ParentTree and supports scalar or array
Kentries without relying on producer state - Local navigation requires structure destinations, applies
SDbefore a compatibleDfallback and validates nested page-label number trees - XMP properties are resolved by namespace URI so valid alternate prefixes remain interoperable
- Table diagnostics distinguish invalid spans, cell intersections, irregular rows and row groups, cross-table IDs, duplicate or cyclic header references and missing algorithmic associations
- List diagnostics distinguish invalid numbering, unwrapped content, label and body structure, ordered same-level continuation references and continuation cycles
- Expanded table geometry shares the
MaxObjectsbound and fails closed withua2.table.limit.cells ua2.limit.objectsfails closed before scanning an oversized graph
Machine-readable findings
The THPDFComplianceFindings overload maps the same bounded validation pass into the shared compliance model without changing validation order or mutating the graph
Each finding identifies PDF/UA-2, severity, rule ID, standard clause, path, object number, page index, message and a crsNotAttempted repair state