RepairAnnotationAppearances
Annotations, document repair, performance
Description
Scans every page once and rebuilds normal appearance streams for supported markup, shape, path, free-text and icon annotation types
Syntax
Function TPDFlib.RepairAnnotationAppearances(OnlyIfNecessary: Integer; Out Stats: TPDFlibAnnotationAppearanceStats): Integer;
Parameters
| OnlyIfNecessary | Nonzero repairs only annotations with a missing, stale, invalid, state-mismatched or invisible appearance; zero regenerates every supported annotation appearance |
|---|---|
| Stats | Receives scan, issue and repaired-category counters measured before changes are applied |
Return values
Returns the number of annotation appearance streams rebuilt
Remarks
Generated streams carry a compact source fingerprint, allowing later changes to geometry, colour, border, content or path data to be detected as stale without rasterising the page
Widget annotations are counted but remain the responsibility of RegenerateFormAppearances, while annotation types that do not require an appearance stream are ignored
The previously selected page is restored before the function returns
See also
GetAnnotationAppearanceAuditJSON, TPDFlibAnnotationAppearanceStats, RegenerateFormAppearances