mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-26 11:08:48 -06:00
Review on #3943. A black-box test of Acrobat (synthetic form, Save As and Ctrl+S, every decoded object searched) showed how it saves a Password field: the typed value is nowhere in the file; a field with /DV is saved holding /DV, one without is left empty; the asterisks are drawn from the saved value (5 for a 5-letter default, not 13 for the typed password); /DV and /AA are kept. clear_password_values now does the same: it restores the (inherited) /DV as the value, or leaves the field empty, and redraws the widgets, so the appearance no longer shows how long the typed password was. A field already at its default no longer counts as holding a password, so such a form needs no cleaned copy. The parity note for form.fill-text says so and lists the two limits Acrobat shares (a script copying the password into an ordinary field, and an earlier revision kept by an incremental save). Mutants, each failing a test: no /DV restore, no redraw, the default ignored in password_fields, emptiness ignored (an empty string in an array). Dropping the empty-default filter was equivalent, so the filter is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>