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

Adobe Forms- Duplicating Textboxes

Explorer ,
Jan 11, 2024 Jan 11, 2024

Hello everyone,

 

Being a proficient knowledgable user of Adobe forms, there is one thing that I still have not figured out and need assistance with. I have to create textboxes multiple one for a document over 300 pages. If I create using the Duplicate forms option in Adobe Acrobat, the boxes are copied over to all the pages in one go, but then those boxes are not unique. That forces me to change the name of each box individually and for a 300 page document, that takes time.

 

Is there is a solution that can expedite the above task?

 

Thank you

 

 

TOPICS
Create PDFs , Edit and convert PDFs , PDF , PDF forms
840
Translate
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 11, 2024 Jan 11, 2024

You can't rename fields with a script, but you can replace text fields with new fields in the same place and give those fields unique names using script, but if you have any formatting/scripts in old fields it will not copy to new fields.

Translate
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
Explorer ,
Jan 19, 2024 Jan 19, 2024

Yes, you are right however, that does still present me with the same problem.

 

Thanks though!

Translate
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 11, 2024 Jan 11, 2024

It would be much easier to write a console script to create the fields using your own naming scheme. 

For example:

var oFld;
var rectField = [....];
var cBaseName = "MyField";
for(var i=0;i<this.numPages;i++)
{
   oFld = this.addField(cBaseName + i, "text",i, rectField );
   oFld.textFont = ...;
   oFld.textSize = ...;
   ... and whatever other properties need to be set...
}

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
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
Explorer ,
Jan 19, 2024 Jan 19, 2024

Hello Thom,

 

Thank you for your response. So, I am not too familiar with scripting and its usage. I can tell you that all I really need to do is to create a textbox  that should have multi-line text in it and thats basically it.This textbox should be located on the right side of the page, on each page of a 300 pg document with the same dimensions and those boxes should be unique. This will save me time to change the name of each box individually and for a 300 page document, that takes time.

 

Thanks in advance.

Translate
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 19, 2024 Jan 19, 2024

You may want to take a look at...

https://www.try67.com/tool/easily-rename-pdf-fields

I haven't used this particular tool but have used many of try67's other PDF tools, defintely saves a ton of time.

Translate
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 19, 2024 Jan 19, 2024
LATEST

If you are in the development phase of creating the form. It is much better to use console scripts to create fields than to rename them.  The script I provided above will create all the fields with the require name and properties, and in the correct location in less then one second.   

Let me repeat that. The one small console script will create all the fields in this field set exactly the way you want in less than one second.  

You will need to spend a little bit of time getting the correct location and working out the field properties that will need to be set. But that's peanuts compare to the effort required to rename existing fields. 

 

To do this. Start by placing a field on the first page.  Name it "Text1" and put it in the position and set the properties the way you want. 

Next, run this code in the console window

this.getField("Text1") .rect

 

This give you the exact rectangle you'll need for the script. Next, look up the names of the properties the field needs in the Acrobat JavaScript reference:

https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/JS_API_AcroJS.html

 

Run code similar to the line above for any properties that you don't know the value of. Since you've already set it up in the field. The returned values will be the ones you want to use in the script. 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
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