this is my first question so please be kind with me.
We've been having a problem lately with fillable PDF forms. Essentially the data seems to disappear completely if it has been keyed in and then saved on a Macintosh (You can read more about this here: https://forums.adobe.com/message/3951187)
I preapared the following script to automate this process (Thanks to JoelGeraci for this. You can check out his GitHub page for more info @ https://gist.github.com/JoelGeraci/05e15f3792b299b68be900ab4489e959) but it doesn't cycle through every field when I run in adobe reader DC. Any advice on how I can fix this?
Code:
/*Code to fix broken PDF Forms*/
//Check version
if (app.viewerType != "Reader" || app.viewerVersion >= 11) {
app.addMenuItem({
//Add new menu item under the "Edit" tab
cName: "PPDF_fixFields",
cUser: 'Fix Field Appearances',
cParent: 'Edit',
//Run the function "fixFields()"
cExec: "fixFields()",
//Enable this option if the number of fields is greater than 0
cEnable: "event.rc = (this.numFields > 0);"
});
function fixFields() {
//Number of Fields
nFields = this.numFields;
//shows the progress bar
var t = app.thermometer;
t.duration = nFields;
t.begin();
//Cycle through all fields
for (var i = 0; i < nFields; i++) {
//nth Field
var f = this.getField(this.getNthFieldName(i));
//toggle delay to refresh content
f.delay = true;
f.delay = false
//progress bar
t.value = i;
}
//End progress bar
t.end();
//Producer info
if (app.viewerType != "Reader") {
this.info.Producer = "Adobe Acrobat " + app.viewerVersion
}
}
So, you also noted that Preview.app is sheer poison for a PDF form. Unfortunately, the damage is not just to not create the appearances, but any logic in the form gets destroyed as well.
Therefore, it would be safer to just export the form data (which is actually still there) as FDF, and import it into a blank version of the form. Export/Import should be available in Reader XI and newer.