function InspectPdfUaUnicodeCoverage: TPdfUaUnicodeCoverageReport; overload;
function InspectPdfUaUnicodeCoverage(const Options: TPdfUaUnicodeCoverageOptions): TPdfUaUnicodeCoverageReport; overload;
The method scans each PDFium text page once and groups explicit characters by their originating native text object
A character is covered by a nonzero direct Unicode mapping or by printable ActualText attached to that exact text object, so replacement text cannot mask adjacent content
Artifact characters and PDFium-generated characters are counted separately and excluded from semantic coverage
Each stored TPdfUaUnicodeObjectCoverage records the page, PageObjectIndex when available, MCID, the FirstCharacterIndex, direct and replacement counts, mapping failures, and bounded ActualText evidence with its ActualTextApplied and ActualTextTruncated flags
The default options store only uncovered objects, cap evidence at 1000 objects, and cap each ActualText excerpt at 256 characters while aggregate counts continue across the whole document
Completed is False when required PDFium APIs are unavailable, a page cannot be loaded, or native character state cannot be read; already collected counts and evidence remain available
| Member | Purpose |
|---|---|
IncludeCoveredObjects | Stores covered object evidence as well as uncovered evidence |
MaxReportedObjects | Caps stored object evidence without stopping aggregate counting |
MaxActualTextCharactersPerObject | Caps each stored replacement excerpt while preserving character counts |
DirectUnicodeCharacterCount, ActualTextCharacterCount | Count the two successful semantic extraction paths |
SemanticCharacterCount, ArtifactCharacterCount, GeneratedCharacterCount | Split all scanned characters into semantic, Artifact, and PDFium-generated totals |
UncoveredTextObjectCount | Counts scanned text objects with at least one Unicode map error or missing direct Unicode mapping, the objects whose extraction a repair pass must fix |
CoveredTextObjectCount, ActualTextObjectCount, InvalidActualTextObjectCount, PagesScanned | Object-level coverage totals and scan progress of the TPdfUaUnicodeCoverageReport |
UnicodeMapErrorCharacterCount, MissingUnicodeCharacterCount | Count native mapping errors and zero Unicode values |
UnresolvedTextObjectCharacterCount | Counts explicit semantic characters whose source object cannot be resolved |
ReportLimitReached | Indicates that additional matching objects were counted but not stored |
IsCovered | Returns True only for a completed scan with no mapping, missing Unicode, or unresolved-object failures |
var Report: TPdfUaUnicodeCoverageReport;
Report := Pdf1.InspectPdfUaUnicodeCoverage;
if Report.Completed and not Report.IsCovered then
ShowMessage(IntToStr(Report.UncoveredTextObjectCount) + ' text objects need repair');