• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Rename all fields on a Form

Community Beginner ,
Dec 19, 2021 Dec 19, 2021

Copy link to clipboard

Copied

Is there a way to rename all fields on a large form

     From: field's current name e.g. "type of defect"

     To: field's page number +  current name e.g. "page6_type of defect"

TOPICS
JavaScript , PDF forms

Views

10.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , Dec 19, 2021 Dec 19, 2021

I had thought that this can't be done with Javascript, which is the way that I'd do any such mass renaming. However, a few minutes of searching led me to this page, where Forums Regular try67 offers tools that automate this kind of task. They kind of give it away in their first paragraph of description; if you were automating field renaming with JS, " it requires removing the old field and then creating a new one in its place with the new field name." That certainly can be automated with JS. 

 

...

Votes

Translate

Translate
Community Expert , Dec 20, 2021 Dec 20, 2021

Simple and free solution:

Install the demo version of Qoppa PDF Studio 2021 and open a copy of your form with it.

Find the "Sequential Renaming" function (right-click), rename selected fields and save.

Open the watermarked copy with Acrobat Pro and copy-paste the modified fields into your original form.

 

I've been waiting for Adobe to implement this feature in Acrobat Pro for so long...

 

Capture_44.png

Votes

Translate

Translate
Community Expert ,
Dec 19, 2021 Dec 19, 2021

Copy link to clipboard

Copied

I had thought that this can't be done with Javascript, which is the way that I'd do any such mass renaming. However, a few minutes of searching led me to this page, where Forums Regular try67 offers tools that automate this kind of task. They kind of give it away in their first paragraph of description; if you were automating field renaming with JS, " it requires removing the old field and then creating a new one in its place with the new field name." That certainly can be automated with JS. 

 

So in your shoes, I would personally try to do exactly that in JS, but that's because I enjoy trying to figure out how to do that kind of thing. However, if I were on the clock or working with a client, I would reason that spending $10 would be the best move, in terms of a cost-benefits analysis. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 20, 2021 Dec 20, 2021

Copy link to clipboard

Copied

To aid my learing and given this is not a high priority, I am going to give it a try. Seen a few posts to dynamically create fields in sepecified location just not sure I can get the same size and location.

Stay tuned and I will post progress.

 

Thank You!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2021 Dec 20, 2021

Copy link to clipboard

Copied

Simple and free solution:

Install the demo version of Qoppa PDF Studio 2021 and open a copy of your form with it.

Find the "Sequential Renaming" function (right-click), rename selected fields and save.

Open the watermarked copy with Acrobat Pro and copy-paste the modified fields into your original form.

 

I've been waiting for Adobe to implement this feature in Acrobat Pro for so long...

 

Capture_44.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 13, 2023 Jan 13, 2023

Copy link to clipboard

Copied

Couldn't find the "sequential renaming" function in Qoppa, BUT, I did find out they don't have a "run form field recognition" function function in the software that recognizes boxes, lines, etc in a pdf file and automatically creates a form field. Makes this software useless in my opinion.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 13, 2023 Jan 13, 2023

Copy link to clipboard

Copied

Select several fields, right-clic on any one : Sequential renaming

 

Capture_2301132208.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 14, 2023 Jan 14, 2023

Copy link to clipboard

Copied

Thank you for your response I'll give it a try.

Still disappointed that Qoppa doesn't have the form field recognition. Their solution was to create multiple fields of the same size and place them individually in the document. Seems like a big time waster. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 31, 2024 Mar 31, 2024

Copy link to clipboard

Copied

Amazing @JR Boulay !!!

 

Thanks for sharing that ... finally something I can employ in Linux too!

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2021 Dec 20, 2021

Copy link to clipboard

Copied

It is possible when you create a plugin for Adobe Acrobat.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2021 Dec 20, 2021

Copy link to clipboard

Copied

OP doesn't want to create a plugin, she just wants to rename several fields at the same time.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2021 Dec 20, 2021

Copy link to clipboard

Copied

A plugin can rename fields.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 22, 2023 Sep 22, 2023

Copy link to clipboard

Copied

This questions is 2 years old by now ... any solutions other than Qoppa?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 22, 2023 Sep 22, 2023

Copy link to clipboard

Copied

Well, there are the other solutions that have already been discussed in this thread. If you'd looked at try67's page, you'd find this tool, which is explicitly a PDF form field renaming tool. (I can see in my post from 2 years ago that I tried to, or meant to, post a link to the tool; I can't guess why the link isn't in that post.) 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 22, 2023 Sep 22, 2023

Copy link to clipboard

Copied

Thanks for your reply. There are 3 'levels' presented there. The first 2 are out because they required Java and our IT dept does not allow java. Not sure about the 3rd

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 22, 2023 Sep 22, 2023

Copy link to clipboard

Copied

The third runs within Acrobat, and so therefore to my understanding has to be Javascript (not Java). If you can live with its limitations, then it might be a good solution for you.

 

Another solution I've used in your shoes is this: I've gone to IT with a proposal, demonstrating that it's possible to sandbox Java well enough to give me command-line access to it for long enough to complete whatever Java-specific task I needed to do. (Then when I was done, they nuked my sandbox VM into its component atoms. Then, every further instance in which I needed command-line access to Java, we went through the same rigamarole, from proposal to radioactive dust.) 

 

I have to say that, while there might be many tools that would be useful to you out there, I don't know what they are. I've written my own tools to rename form fields en masse, which is where I imagine most users who need to rename Acrobat form fields wind up doing. When I search for potential solutions for you, I've found some possible candidates that I know literally nothing at all about. For example, I know nothing at all about SyncFusion, but it claims to contain .NET libraries that will let you easily rename form fields. So there are going to be solutions out there, but they might be obscure, or overkill for your circumstances. 

 

(My own tools are very specific to my own localization projects, each one written for a particular client's idiosyncracies, and not particularly portable, or honestly I'd be sharing them right now.)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 29, 2024 Mar 29, 2024

Copy link to clipboard

Copied

I'm just posting to say that it makes me sad that I wasted a free trial to add text form fields only to find that duplicating them results in a problem that only third party solutions can solve unless you learn to script or take an ungodly amount of time to rename them manually. Is there a place to make product requests? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 31, 2024 Mar 31, 2024

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 31, 2024 Mar 31, 2024

Copy link to clipboard

Copied

Thank you

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 10, 2024 May 10, 2024

Copy link to clipboard

Copied

While I realize this initial post began several years ago, I found it by accident since I presently need to rename approximately 22 form fields on an interactive PDF form I created years ago as I am in the middle of updating the form and need to rename approximately 22 form fields. Needless to say, I really don't feel like renaming every form field on the form individually as it's altogether boring and very time consuming  to say the least. However, around 18 years ago I had created a script to rename form fields while I was designing/developing interactive PDF forms for family, friends, and myself. Unfortunately, to quote an old saying, hindsight is 20/20, and I failed to save the script.  However, while I don't presently have the script, time permitting I am contemplating recreating one in JS like I had done years ago and when I am finished, I intend to post the script to the forum for others to copy/use as a way of giving back what I have learned from others over the years. This aside, getting back to creating a JS to rename existing form fields on a PDF form really isn't that difficult to achieve. In reality, if memory serves me correctly, the steps to create the JS begin with a 'for' loop whereby you essentially iterate through the form fields one by one, obtain/save the rectangular coordinates for each form field in a variable for later use, delete the old form field, and create the replacement field assigning a new name and the same rectangular coordinates you obtained/saved from the old form field you since deleted/replaced and you're done. Needles to say, all the methods used are listed and explained in the Javascript for Acrobat API Reference back then and now. Why I failed for whatever reason to save the script I created years ago to rename form fields residing on a PDF form I really don't know given the script worked like a charm. Once again, I will post the script to the forum when done as this really should have been provided by Adobe a long time ago.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 11, 2024 May 11, 2024

Copy link to clipboard

Copied

OK. Given the lack of comments since my initial post, it appears that 1) no one is interested in a script to rename form fields residing on a PDF form,  2) Most everyone either purchased a script to accomplish this task, or 3) Most everyone who patronizes the Acrobat community forum already knows how to create a script to rename fields residing on a PDF form. This aside, shortly after I had completed my initial post regarding this subject matter, I decided to try my hand at creating a script to rename existing form fields, no matter how many, on a PDF form.  However, I should begin by stating that the script I created in about 5-10 minutes is by no means the most elegant or a one size shoe fits all meaning the script will more than likely require some modifications/tweaking to fit one's needs. For example, given that I prefer to use form field naming conventions using the dot notation, i.e., name.0, my for loop doesn't use the 'numFields' property  or getNthFieldName method like most including some other habits acquired over time to help shorten my scripts. However, what's important is that using the script I created, I was able to rename 161 form fields in about 15 seconds as opposed to renaming each and every form field individually in Acrobat Pro without using a script that would have taken me (the one finger typist) at least 1-3 hours based on 1-3 minutes to rename each field. Before I provide the script, I should also add that given 23 rows and 6 columns of form fields whereby the fields provided in each column have different names, i.e., workItem.0,  workItem.2, ....workItem22, contractor.0, contractor.1, contractor.2,....contractor.22, etc., I basically ran the script 6x changing the field name inside the script for each column of form fields to be renamed. Like I already stated, not the most elegant but it worked like a charm. And yes, I realize I could have taken a few extra minutes to have rewritten the script so I would have only needed to run it one time to rename all fields. However, I will leave that up to you. All said here's the script I created/used for my needs to rename 161 form fields. Enjoy.

 

for(i=47;i<70;i++){
oldFld = getField("oldName."+i);
var oldRect = oldFld.rect;
this.removeField(oldFld);
newFld = this.addField("newName."+(i-23), "text", this.pageNum, oldRect);
newFld.strokeColor = color.transparent;
newFld.fillColor = color.transparent;
newFld.textColor = color.black;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 02, 2024 Aug 02, 2024

Copy link to clipboard

Copied

I am VERY new to the Prepare Form function. When/How do I run the script - before or after I've created the duplicate form fields?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 03, 2024 Aug 03, 2024

Copy link to clipboard

Copied

LATEST

Beware that this script will result in the loss of all actions, formats, validations and calculations.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines