Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Adds a menu item to repair form field appearances in Adobe Acrobat and Reader
/*
Version 1.4 (Updated for Acrobat DC)
Folder Level Javascript Created by Joel Geraci - joel@practicalpdf.com
*/
if (app.viewerType != "Reader" || app.viewerVersion >= 11) {
app.addMenuItem({
cName: "PPDF_fixFields",
cUser: 'Fix Field Appearances',
cParent: 'Edit',
cExec: "fixFields()",
cEnable: "event.rc = (this.numFields > 0);"
});
function fixFields() {
nFields = this.numFields;
var t = app.thermometer;
t.duration = nFields;
t.begin();
for (var i = 0; i < nFields; i++) {
var f = this.getField(this.getNthFieldName(i));
f.delay = true;
f.delay = false
t.value = i;
}
t.end();
if (app.viewerType != "Reader") {
this.info.Producer = "Adobe Acrobat " + app.viewerVersion
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment