RegenerateFormAppearances
Form fields, performance
Description
Traverses the complete AcroForm field hierarchy and regenerates each visible Widget appearance stream
Syntax
Delphi
Function TPDFlib.RegenerateFormAppearances(OnlyIfNecessary: Integer): Integer;Parameters
| OnlyIfNecessary | Use a nonzero value to preserve usable existing appearances, or 0 to rebuild supported appearances |
|---|
Return values
| 0 | No visible Widget appearance was regenerated |
|---|---|
| Positive value | The number of Widget appearance streams regenerated successfully |
Remarks
The traversal starts at root fields and visits each descendant once, including Widget leaves under logical parent fields
When every visible Widget succeeds, the current-session dirty set is cleared and NeedAppearances becomes false; failed Widgets remain dirty and keep the flag true
Use this complete scan for imported documents whose pre-existing missing appearances are not represented by the current-session dirty tracker
For large forms changed through this library during the current session, prefer RegenerateDirtyFormAppearances so work scales with the affected Widget set