Skip to content

Stabilize Recalculation of Form PDFs - #5318

Merged
JorjMcKie merged 3 commits into
mainfrom
improve-form-recalculation
Nov 30, 2026
Merged

JorjMcKie merged 3 commits into
mainfrom
improve-form-recalculation

Conversation

@JorjMcKie

Copy link
Copy Markdown
Collaborator

In method recalculate_form() we previously only erased the /AP/N of widgets whose parent is involved in cross-field computations - thus leaving them without this key.

This caused some viewers to leave the displayed value empty. While many viewers dynamically create the correct display based on the fields recomputed value /V (recomputed) prominent ones like Adobe Acrobat show an empty field.

This fix addresses this by regenerating a new /AP/N.

A minor other issue is only observed with Adobe Acrobat: One of the standard repair activities of FormFields is the insertion of default /DA and /DR values in the /Root/AcroForm dictionary if not yet present. However, whenever these defaults are incompatible with the /DA / /DR keys of any widget, their values are not displayed. The fix is simply never adding default values for these keys.

In method `recalculate_form()` we previously only erased the
`/AP/N` of widgets whose parent is involved in cross-field
computations - thus leaving them without this key.

This caused some viewers to leave the displayed value empty.
While many viewers dynamically create the correct display based
on the fields recomputed value `/V (recomputed)` prominent
ones like Adobe Acrobat show an empty field.

This fix addresses this by regenerating a new `/AP/N`.

A minor other issue is only observed with Adobe Acrobat:
One of the standard repair activities of `FormFields` is the insertion
of default `/DA` and `/DR` values in the `/Root/AcroForm`
dictionary if not yet present. However, whenever these defaults are incompatible with the
`/DA` / `/DR` keys of any widget, their values are not displayed.
The fix is simply never adding default values for these keys.
@JorjMcKie
JorjMcKie merged commit 0940c86 into main Nov 30, 2026
3 checks passed
@JorjMcKie
JorjMcKie deleted the improve-form-recalculation branch November 30, 2026 12:43
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants