I wrote the original version of this script nearly 10 years ago when I was employed by Adobe and it seems that Apple still hasn’t done anything about the problem it solves. So… it’s time for yet another update.
Users of Acrobat and Reader continue to run into problems where PDF forms are being filled out by users of Preview on macOS and sent back to folks with Acrobat or Reader. Unfortunately, when the recipients open the file, form fields appear blank until they click into them and then go blank again when they exit the field.
This seems a little strange… and it is… but there’s a very good technical explanation. In PDF, the value of a field and it’s “appearance” are two completely different things. This lets form authors do some pretty cool tricks with date strings and other types of formatting but can cause problems with non-conforming PDF viewers like Mac Preview.
In this case, macOS Preview isn’t writing any appearance information into the fields nor it is setting the “needs appearance” flag which tells a PDF viewer to generate an appearance for the field. The “needs appearance” flag is intended to tell the application rendering the PDF file that the data in a field has been changed by some other tool and that it didn’t also generate an appearance for the field… a server script that pre-populates fields for example. The result of not performing either of these function is that when Acrobat or Reader displays the file, the fields are blank until you click into the field displaying the field value.
The “delay” property delays the redrawing of a field’s appearance. It’s generally used to buffer a series of changes to the properties of the field before requesting that the field regenerate its appearance. Setting the property to true forces the field to wait until delay is set to false. The update of its appearance then takes place, redrawing the field with its latest settings.
This simple trick forces Acrobat or Reader to create proper appearances for all the fields in the document without changing the values and without causing recalculations. After running the script, the field values should appear.
The script should work in Acrobat 9 and higher or Adobe Reader XI and higher.
Download the script from GitHub and then follow the installation instructions for folder level scripts at pdfscripting.com
Look at the bottom of the “Edit” menu for “Fix Field Appearances”. Open your form and then select the menu item. Your fields should magically show up.