Created
December 4, 2016 20:05
-
-
Save JoelGeraci/05e15f3792b299b68be900ab4489e959 to your computer and use it in GitHub Desktop.
Adds a menu item to repair form field appearances in Adobe Acrobat and Reader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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