Skip to main content
lizareed5
Participating Frequently
February 20, 2018
Question

How can you duplicate pages without having the fields read each other?

  • February 20, 2018
  • 4 replies
  • 60880 views

I have a 2-page form that needs to be repeated 14 times (making it 28 pages long in total). Instead of creating the fields 13 more times, I tried to duplicate the pages, but then realized that makes all of the editable fields repeat once you type something in. I've been googling and reading community threads for a while now and seem to only get halfway there. I understand there is a way to do it by creating page templates, but I that isn't working. And people have said that I need to enter in javascript code, which I do not know how to do either.


Can anyone help with a user-friendly solution? Thank you!!

4 replies

Inspiring
February 20, 2018

As you mentioned, setting up a template and executing a simple script is an option. When you first set up each of the initial pages as a template page, you'll give each a name, such as P1 and P2. You can then execute the following JavaScript code in the interactive JavaScript console (Ctrl+J) to create 13 additional copies of P1 and P2. The fields will be renamed so they are independent.

// JavaScript to create duplicate pages from templates P1 and P2

var num_copies = 13;  // Set the number of copies here

var T1 = getTemplate("P1");  // Use the actual tempate name here

var T2 = getTemplate("P2");  // Use the actual tempate name here

if (num_copies > 0) {

    var oXObjT1 = T1.spawn({nPage: numPages, bRename: true, bOverlay: false});

    var oXObjT2 = T2.spawn({nPage: numPages, bRename: true, bOverlay: false});

    if (num_copies > 1) {

        for (var i = 1; i < num_copies; i += 1) {

            T1.spawn({nPage: numPages, bRename: true, bOverlay: false, oXObject: oXObjT1});

            T2.spawn({nPage: numPages, bRename: true, bOverlay: false, oXObject: oXObjT2});

        }

    }

}

To execute the code, select it all and press Ctrl+Enter, or Enter on the numeric keypad

lizareed5
lizareed5Author
Participating Frequently
February 21, 2018

Thank you! This is making more sense. I really appreciate all of your help!!! It worked!

JR Boulay
Community Expert
February 20, 2018

You need to have the same fields on each page BUT each one must have an unique name, otherwise they share their content.

When you right-click on a field in Acrobat Pro, you can:

"Duplicate across pages" : does what it says, without renaming fields.

"Create multiple copies" : does what it says and rename fields, but only on one page.

So:

- Create a big sized blank new PDF, let's say an A0 format (you can use this free tool).

- Cut and paste all your fields into this new PDF.

- Select all fields : Right-clic : Create 14 multiple copies (this is why you need a big sized PDF).

- Cut and paste each of the 14 group of renamed fields into your 14 pages.

Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
February 20, 2018

You can do it very easily using this tool I've developed: Custom-made Adobe Scripts: Acrobat -- Duplicate Page (including Form Fields)

Thom Parker
Community Expert
February 20, 2018

In "Prepare Form" mode, Select all the fields you want duplicated and right click to show the popup menu. Towards the bottom there is an option for duplicating across pages.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
lizareed5
lizareed5Author
Participating Frequently
February 20, 2018

Thank you! I just tried that and the fields still read one another though.

Thom Parker
Community Expert
February 20, 2018

Wow, I didn't test it. Sorry about that. I Just figured that if Adobe went through the trouble of making a function to specifically duplicate across pages that it would rename them. Makes that feature kind of useless doesn't it.

I guess Try67's tool is the only option.

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