THPDFUA2RepairOptions Record
Per-repair switches, fallback content and work limits for the repair of a PDF/UA-2 structure tree
Declaration
THPDFUA2RepairOptions= record
NormalizeDuplicateNamespaces: boolean;
RegisterReferencedNamespaces: boolean;
RepairStandardStructureNamespaces: boolean;
RepairAttributeNamespaces: boolean;
RepairAttributeRevisions: boolean;
RepairListSemantics: boolean;
RepairTableSemantics: boolean;
RepairRubyWarichuSequences: boolean;
RepairPronunciationHints: boolean;
RepairMissingAlternateText: boolean;
RepairLanguageInheritance: boolean;
RepairHeadingOrder: boolean;
RepairArtifactTagging: boolean;
AllowDocumentFragmentHeadingStarts: boolean;
RollbackOnValidationFailure: boolean;
CustomAttributeNamespaceURI: AnsiString;
DefaultLanguage: AnsiString;
FallbackAlternateText: AnsiString;
MaxGeneratedAlternateTextCharacters: Integer;
MaxObjects: Integer;
MaxRepairs: Integer;
class function Default: THPDFUA2RepairOptions; static;
end;
Unit
HPDFDoc
Fields
| Field | Purpose |
|---|---|
NormalizeDuplicateNamespaces | Merge duplicate namespace entries together in the structure tree namespaces |
RegisterReferencedNamespaces | Add a Namespace dictionary entry for each NS value that structure elements reference |
RepairStandardStructureNamespaces | Put right malformed references to the PDF 2.0 standard structure namespace |
RepairAttributeNamespaces | Repair the namespace wiring on structure attribute objects |
RepairAttributeRevisions | Normalise the Revision values of attribute objects and revision-bearing elements |
RepairListSemantics | Rebuild the List, ListNumber and ListLabel structure of broken lists |
RepairTableSemantics | Rebuild Table, TR, TH and TD hierarchies with proper scopes and spans |
RepairRubyWarichuSequences | Bring Ruby and Warichu child sequences back into the required order |
RepairPronunciationHints | Repair the phoneme pronunciation hints on structure elements |
RepairMissingAlternateText | Generate /Alt for figures and other elements that want it |
RepairLanguageInheritance | Fill in missing /Lang entries down the structure hierarchy |
RepairHeadingOrder | Reassign heading levels so that H1-H6 descend without gaps |
RepairArtifactTagging | Tag content marked as artifacts so that it stays out of the structure tree |
AllowDocumentFragmentHeadingStarts | Allow documents whose structure tree starts below H1, as document fragments do |
RollbackOnValidationFailure | Undo each applied repair when post-repair validation still fails |
CustomAttributeNamespaceURI | Optional URI used whilst rewriting custom attribute namespaces; empty by default |
DefaultLanguage | Language tag that language inheritance repair applies; empty skips the rewrite |
FallbackAlternateText | Text to use where no better /Alt can be derived; empty leaves the element unresolved |
MaxGeneratedAlternateTextCharacters | Cap on the characters generated for a single /Alt value; the default is 4096 |
MaxObjects | Cap on the objects examined; the default is 1000000 |
MaxRepairs | Cap on the individual repairs applied per run; the default is 100000 |
Usage notes
- Start from
THPDFUA2RepairOptions.Default, which enables every repair switch plus rollback, then switch off categories you would rather not have touched - Repair limits put a stop to runaway runs on damaged documents; the report's
LimitExceededflag tells you when a cap was hit - With
RollbackOnValidationFailureenabled, a failed post-repair validation leaves the document byte-identical to the state it was in before