How to bulk rename form fields with unique names?

I made a PDF with over 100 fillable form fields. But I did it with copy and paste. Now all the form fields have the same name (Name1) and filling in one will fill in all the others with the same info.

Is there any easy way I can bulk rename all of my existing form fields with unique names?

Notes
1) I have Acrobat 11 for Mac
2) I'm not too confident with scripts, but if someone is able to provide detailed instructions on how to use them to solve this issue inside Acrobat I might be up for it

Any easy solutions would be gratefully appreciated!

Thanks so much,

Joe


Joe Mitchell


5 Answers

Hi Joe,

There is no clean easy way to do that, even with a script. To save a little time when you rename the fields manually, you can leave the field Property dialog box open and just click on each field to change the name so you don't have to open the Properties dialog again for every field.

Hope this helps,

Dimitri

WindJack Solutions

www.pdfscripting.com


Dimitri Munkirs   

You can't 'rename' fields but you can get the same result by recreating the fields with a different name for each field then removing the original fields. Run this script in the console to accomplish this:

for (var i=0;i<200;i++)
{
try{
var rct=this.getField("Name1."+i).rect;
var pg=this.getField("Name1."+i).page;
this.addField("name."+i,"text",pg,rct);
}catch(e){break}
}
this.removeField("Name1");


David Dagley   

David's script will rename the fields so that is good. But if you have added any other Properties to the fields (font, size, color, etc) those will get lost and all the new fields will have Acrobat's Current Default Properties for a text field. If you just used the default Properties then this should work.

Dimitri

WindJack Solutions

www.pdfscripting.com


Dimitri Munkirs   

Dimitri is correct that default properties will be used and I assume that's what was done. You can program any other properties like this:

    for (var i=0;i<200;i++)
    {
    try{
    var ts=this.getField("Name1."+i).textSize;
    var tf=this.getField("Name1."+i).textFont;
    var rct=this.getField("Name1."+i).rect;
    var pg=this.getField("Name1."+i).page;
    var f=this.addField("name."+i,"text",pg,rct);
    f.textSize=ts;
    f.textFont=tf;
    }catch(e){break}
    }

this.removeField("Name1");


David Dagley   

As was mentioned, if you do it within Acrobat then you lose some of the settings associated with the fields (such as custom actions, format, validation, calculation, etc.), but the rest of the properties can be maintained.

I have developed a script that does that for you, exactly for this situation: Acrobat -- Rename Duplicate Fields to Unique Fields

.


Visit my custom-made PDF scripts website: http://try67.blogspot.com
Contact me personally: try6767@gmail.com


Gilad D (try67)   


Please specify a reason: