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

Duplicate a field across multiple pages with unique names

Community Beginner ,
Apr 25, 2018 Apr 25, 2018

Copy link to clipboard

Copied

I am quite certain this has been asked before, but it boggles my mind that there isn't a better answer than "you have to do it with custom code."

I have a document which needs the same 50 odd forms to be placed on 16 different pages. I try clicking "Create Multiple Copies" - and get "Cannot create multiple copies of this selection...." So I made absolutely sure each field on the initial page had unique names. Create Multiple Copies only duplicates the fields on the current page??

Oh good, there's a "Duplicate Across Pages" option. It only makes linked fields with the same name?? Really? So I have to rename 750 form fields by hand?

I can't imagine the developers really think people would want to copy a large number of fields onto multiple pages of a document but only have the option to keep their content linked together.

How hard would it be for them to include a simple checkbox in the "duplicate across pages" dialog "make unique copies" or the like. How hard would it be for them, if nothing else, to make a "paste special" option, allowing us to paste a bunch of fields without their being linked.

Apologies if I'm missing something, but I find it difficult to understand how in 20+ years of development, no one has thought "You know, maybe people should have an easy way to make unique copies of the same form fields..."

TOPICS
PDF forms

Views

14.7K

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 1 Correct answer

Community Expert , Apr 25, 2018 Apr 25, 2018

You'll find a tutorial on using the console window here:

Free Video Content & Full Listing of Available Videos

Here is some info on writing automation scripts:

Automating Acrobat can save you loads of time.

The question for Adobe is not why didn't they create better form design tools, but why would they? These tools have only had a couple of upgrades in the past 15 years. So obviously they are missing the proper motivation and direction to do so. Unfortunately that's just the way it is  

Votes

Translate

Translate
Community Beginner ,
Apr 25, 2018 Apr 25, 2018

Copy link to clipboard

Copied

Okay, so I tracked down the option to make the page a template. However, there doesn't seem to be any built-in way to use that template once it's defined. Again, Adobe, how hard would it be to give us the option to spawn pages from a template in the Organize Pages tool??

What I ended up having to do was make the page a template, then create a button on the page, assign it a JavaScript action to spawn copies of the template.

If you'd like to know exactly how to do this, here are the steps (this is in Acrobat Pro DC):

1. Get the forms on the page you need to duplicate completely laid out and working how you want.

2. Click Organize Pages

3. Select the Page you want to duplicate.

4. Click "More > Page Templates"

5. Type in a name for the template. Copy the name since you'll need it in the JavaScript.

6. Click "Add..." then "Close"

Optionally, enter a blank page in the document to put your button on. Don't put it on your template page because you'll end up with copies of that button on every page you spawn from the template.

7. Click "Prepare Form"

8. Create a button - it is the icon that looks like an "OK" button in the toolbar.

9. Cick "All Properties" or right click on the button > & click properties.

10. Select the Actions tab.

11. Under "Select Action" choose "Run a JavaScript

12. Click Add... to open the JavaScript Editor.

13. Copy in the following:

var expTplt = getTemplate("YourTemplateName");

expTplt.spawn(numPages,true,false);

14. Click OK > Close

15. Close out of the Prepare Form mode to view your document.

16 Click the button - it will generate a duplicate of the template page you chose - this will be at the end of your document.

You can now use Organize Pages to place the page wherever you need it.

Note, you can probably use the "numPages" bit to tell Acrobat how many copies or where to put the copies, maybe someone can reply and explain how that would work. Just remember for JavaScript your page 1 is really page 0...

I'm pretty certain for the other two booleans (true, false) the first is for renaming the spawned field (true means yes, rename them).The second is for if you want what you spawn to be part of the existing page - false means no, make a new page.

Again, I'm bothered that I had to do all of that just to pull off something I think must be extremely common when creating pdf forms. I find it ironic that to use a feature that should be built-in, I had to make my own button. It's like I'm doing Adobe's work for them.

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 ,
Apr 25, 2018 Apr 25, 2018

Copy link to clipboard

Copied

You didn't need to put a button on the form, you could have used the JavaScript Console window.  It's there for just this sort of thing. In fact, if you think this is such a miss on Adobe's part (which it is), you could create an automation tool to perform the entire process of creating the template from a specific page and spawning it.

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

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 ,
Apr 25, 2018 Apr 25, 2018

Copy link to clipboard

Copied

You would think having searched around all morning I would have found some mention of the JavaScript Console window. I really appreciate the tip, I'll have to look into it. I suppose I could create a tool as you say - the problem is personally I only anticipate needing to do this once in a while, so the time it takes to figure that out might not be worth it to me.

The larger point is that I shouldn't have to teach myself to be a plugin developer to do something so basic as create un-linked copies of form fields. Why in the world would Adobe think it's a good idea to make the default behavior link form fields? I have built loads of (admittedly simple) pdf forms over the years, and maybe once have I ever needed two fields to have the same content. Is that really so common as to be picked as the default behavior?

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 ,
Apr 25, 2018 Apr 25, 2018

Copy link to clipboard

Copied

You'll find a tutorial on using the console window here:

Free Video Content & Full Listing of Available Videos

Here is some info on writing automation scripts:

Automating Acrobat can save you loads of time.

The question for Adobe is not why didn't they create better form design tools, but why would they? These tools have only had a couple of upgrades in the past 15 years. So obviously they are missing the proper motivation and direction to do so. Unfortunately that's just the way it is  

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

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 ,
Jul 05, 2020 Jul 05, 2020

Copy link to clipboard

Copied

I do use the linked form fields all of the time.  We fill-out multiple forms in one document and use one to fill the next set.  Many times you have to have something like the name/address listed on the bottom of additional pages. 

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 ,
Jul 18, 2020 Jul 18, 2020

Copy link to clipboard

Copied

Not sure why this answer isn't more out there - this is perfect. I can dynamically create subsequent pages anticipating what they will name the fields and can create my xml to match - much appreciated !!!

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 ,
Jan 31, 2023 Jan 31, 2023

Copy link to clipboard

Copied

So what is the final answer?

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 ,
Dec 15, 2023 Dec 15, 2023

Copy link to clipboard

Copied

LATEST

Turns out acrobat makes copies of the selected forms if you right click + "Create Multiple Copies..." and then you basically duplicate the selected forms in their format over the same page you are on. You could do that horizontally on the page and cut and paste the forms (with also unique names) to the next page and basically do this for every page haha

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