These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Changin field names with JavaScript

AndrewAlb
Registered: Aug 16 2007
Posts: 97

Is it possible to change a field name using javascript?
 
I have about 50 forms that follow an outdated naming convention. I need to change all their field names to match the new naming convention. I was hoping to map all this out in a javascript and run all the forms through a batch process - is this possible and if so how can I do it (at least the javascript part)
 
I can easily get the name of the field but any attempts I made to change it were just ignored by adobe.
 
Thanks.

Andrew D. Albrecht, MS
Solutions Developer
ING USFS

My Product Information:
Acrobat Pro 7.0.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
No, this is not possible.

I'm not quite sure how you could automate field name changes. You'll probably have to write a plug-in for it, or use some 3rd party software. This capability is not built into Acrobat.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

AndrewAlb
Registered: Aug 16 2007
Posts: 97
Thanks for responding. Actually in another forum someone suggested that I capture all the necessary attributes needed to recreate the field (textFont, color, rect, etc), then delete the field and create new fields. I tried this on a single field and it worked sufficiently well.

So I was thinking about creating an array list of the original fields names and the new field names and then setting up a script to loop through the array, capture the original field names, then recreate it with the new field name, and continue through the array like that.

Would you have any thoughts on implementing that? Perhaps some hints for me on how to set up the for statement.

Thanks.
-Andrew

Andrew D. Albrecht, MS
Solutions Developer
ING USFS