Copy link to clipboard
Copied
I have a 200+page PDF that has hundreds of fields per page. The pdf is generated from an ERP system, but does not have the fields when it is created, so I run the auto detect forms feature so they can be filled out. All of the fields are created correctly with the exception of ONE! Acrobat puts the form in the wrong spot on the page.
Is there a way to remove ALL of this one field, on each of the pages of the PDF?
Since the Auto Detect feature is used the name of the field is incremented on each page, so the names are not identical.
The naming structure of the filed is "Enter Biweekly Oncall Amount" then increments as Enter Biweekly Oncall Amount_1, _2, _3 etc.
I've seen solutions for identically named fields, but the incrementing is giving me trouble.
Sure, it's possible. Run this code from the JS Console:
var counter = 0;
for (var i=this.numFields-1; i>=0; i--) {
var f = this.getField(this.getNthFieldName(i));
if (f==null) continue;
if (/^Enter Biweekly Oncall Amount/.test(f.name)) {
this.removeField(f.name);
counter++;
}
}
app.alert("Deleted " + counter + " fields.",3);
Copy link to clipboard
Copied
Sure, it's possible. Run this code from the JS Console:
var counter = 0;
for (var i=this.numFields-1; i>=0; i--) {
var f = this.getField(this.getNthFieldName(i));
if (f==null) continue;
if (/^Enter Biweekly Oncall Amount/.test(f.name)) {
this.removeField(f.name);
counter++;
}
}
app.alert("Deleted " + counter + " fields.",3);
Copy link to clipboard
Copied
I must be doing something wrong.
app.alert("Deleted " + counter + " fields.",3);
counter is not defined
1:Console:Exec
ReferenceError: counter is not defined
1:Console:Exec
undefined
Copy link to clipboard
Copied
You need to select the whole code before executing it. Otherwise it will
only execute the current line you're on...
On Mon, Jun 5, 2017 at 10:29 PM, No1UCFfan97 <forums_noreply@adobe.com>
Copy link to clipboard
Copied
Fantastic! thank!