Skip to main content
Inspiring
January 31, 2017
Question

How to build a button that creates a new page in Acrobat Pro DC?

  • January 31, 2017
  • 10 replies
  • 27630 views

Hi all,

I found this tutorial online which is exactly what I want to do, but it's from 2013 and some of the features/steps I cannot find. By chance has adobe made this an easier task?

On a mac.

https://acrobatusers.com/tutorials/how-to-build-a-button-that-creates-a-new-page

This topic has been closed for replies.

10 replies

Participant
February 6, 2022

Hello, do you know if the JavaScript to add an extra page will pass the Adobe accessibility check? TIA!

try67
Community Expert
Community Expert
February 6, 2022

Not likely.

Participant
March 16, 2021

Can you add more than one page to a template. I have a document with 14 pages. I need to offer the option to add an additional page 5&6 and then 7&8. Currently, I have it set up so that each page will populate singularly through a button but I need them to populate at a certain spot in the document. This seems to get tricky when you are giving the option of adding four additional pages. If they add too many of page 5, won't that screw up the spawn position of additional pages?

TIA for any help with this!

try67
Community Expert
Community Expert
March 16, 2021

No. You have to create a separate template for each page.

And no, you can spawn as many copies as you want to all the templates in your file. They don't interfere with one another.

JR Boulay
Community Expert
Community Expert
February 13, 2017

Spawning pages works only with Reader XI (11) and Reader DC, and not with older versions*.

Reader XI (11) and Reader DC don't requires a "Reader Extended" PDF to be able to save it.

And, I don't know why, using "Reader Extended" features prevent spawning pages to work with Reader XI (11) and Reader DC.

So, just "Save as" your form.

But you may want to add a warning message for Reader X (10) and older versions users…

* Spawning pages works with any version of Acrobat Pro or Standard, "Reader Extended" or not.

.

Acrobate du PDF, InDesigner et Photoshopographe
Inspiring
February 17, 2017

Awesome! So far no problems but of course someone always throws a wrench in the works:

Lets say I have a form that on the second page has an area for comments from (for example) an architect. In past we've used word which everyone has been familiar with and people like the fact that the form field and borders carry over to the next page without them having to do anything. I'm guessing that is not possible with acrobat?

As we are moving towards removing word documents and using pdf's there's pushback because we're trying to reduce the verbosity for easier processing.

-After the reviewer inputs their comments the consultant has an area to include their response, which in word could carry over for  multiple pages as well.

-I wanted to create 2 buttons on the review page. One to add a page for reviewer comments and one for the consultant to add additional comments should they run out of room.

Question: if the consultant wants to add a comments to a document that has already grown to 7 pages (thanks to the reviewer), is it possible to have their comments page be inserted after each page they're commenting on or will all the additional pages be added to the end of the document?

Inspiring
March 7, 2017

Here's a question:

I have the add page thing down. It's working great, but what about adding calculations? I just did a test run and the fields my added page comes up as P1.MyTemplate.(fieldname) but the calculations don't carry over. when I looked at the properties the P1.Mytemplate in the calculations area don't carry.

JR Boulay
Community Expert
Community Expert
February 7, 2017

All this is explained in the tutorial, it should be read…

Acrobate du PDF, InDesigner et Photoshopographe
Inspiring
February 7, 2017

JR_Boulay I have read the tutorial. Maybe I'm losing something from the french to english translation? but it seemed like I followed it. Understanding a lot of it I'm not quite sure. This is not a comfort area for me (obviously). Trying to learn as I go. Actually I used the button and script from the tutorial. Copied it over so there were no discrepancies. but still ended up with the example that I posted above a few comments ago.

You are creating the blank form and then making that into a template which can be hidden and used to create a new form page.

1. Create the form.

2. Make form into template.

3. Spawn new page from template with form fields renamed.

4 Rename form fields on the generated form to be prefixed "P0.".

5. Hide template page.

So to clarify  The form is 2 different pages. One that involves the scope of the work and the second (and possible additional pages) would be the recommendations from the various architects, engineers, etc..

The second page would have an "add page" button for the reviewers to add additional comments.

So here's a question: If my additional pages are a duplicate of the second page can the second page be the template and NOT be hidden? Every time I add the duplicate to be used for additional pages I get this prompt. I have no idea how the portfolio function works with a fillable form.

here is the script that I am using:

this.getTemplate("page1").spawn({nPage:this.numPages, bRename:true, bOverlay: false});

JR Boulay
Community Expert
Community Expert
February 8, 2017

Can you share your PDF?

(Acrobat : File menu : Send File : Send & Track : Create anonymous link)

Acrobate du PDF, InDesigner et Photoshopographe
JR Boulay
Community Expert
Community Expert
February 4, 2017

How do I get it so that the button appears on each additional page

Put the button on the template pages.

How do you stop the form from repeating the information in the fields on the additional pages?

You should read the tuto or the JavaScript reference about the bRename method.

Acrobate du PDF, InDesigner et Photoshopographe
Inspiring
February 6, 2017

I read the tutorial and set the bRename to "true", but it still comes through as above.

"BRename: If true, it renames all form fields contained in the model page by adding the prefix P #. Model-name. In the new generated page, where # is the sequence number. So the identical fields do not have the same name on the new pages generated, which allows them to have different contents. Otherwise (false) the identical fields are not renamed in the new generated pages and they share the same content. Of course, this parameter is useful only if the document contains form fields, which is not always the case."

Inspiring
February 6, 2017

The parameter is "bRename". Capitalization is important in JavaScript.

JR Boulay
Community Expert
Community Expert
February 3, 2017

Did you read the tutorial?

Acrobate du PDF, InDesigner et Photoshopographe
Inspiring
February 3, 2017

Yes! I got it to work on a clean file! Thank you!

Now I noticed that the button only exists on the first page. How do I get it so that the button appears on each additional page. The form I'm creating will have reviews from construction sites from people from different principles. Some are more wordy than others  so if they need to keep adding pages for their reviews is it possible to have the button appear on each page?

Inspiring
February 3, 2017

ALSO! How do you stop the form from repeating the information in the fields on the additional pages? Like I've said before my javascript is very very basic.

JR Boulay
Community Expert
Community Expert
February 2, 2017
Inspiring
February 3, 2017

Thank you so much! I copied what was in the files and tried again but each time I put the file in preview and hit the button I get the wheel and then a crash. I'm going to try an unrelated file. Maybe what I've been using has gone corrupt? So frustrating because those sample files work so smoothly and without an issue.

JR Boulay
Community Expert
Community Expert
February 2, 2017

You will find another great tuto for creating new pages here: http://abracadabrapdf.net/ressources-et-tutos/js-et-formulaires-ressources/dupliquer-dynamiquement-des-pages-dans-un-pdf…

(Google translate is your friend)

See also these great samples PDFs:

http://abracadabrapdf.net/file/Trombinoscope-depart.pdf   (start document)

http://abracadabrapdf.net/file/Trombinoscope-final.pdf   (final document)

http://abracadabrapdf.net/file/Trombinoscope-rempli.pdf   (demo document)

.

Acrobate du PDF, InDesigner et Photoshopographe
Inspiring
February 2, 2017

Is there anything out there that gives a tutorial in the latest version of the software? This is interesting but I'm not well versed in javascript and I'm already getting lost in the explanations.

Inspiring
February 2, 2017

Also the example document links don't work on my end.

Inspiring
January 31, 2017

tool"Forms Edit" is now "Prepare Form" tool

"Templates" is located in the "Organize Pages" tool under "More => Page Templates".

The JavaScript remains unchanged.

Inspiring
February 1, 2017

Thanks, I'm going to spend some time with it today and document if it goes wrong and where. I'm sure it's all user error. Unfortunately our IT upgraded us to 2017 without warning or documentation and trying to figure things out with all of my other responsibilities tends to be a bit much. My schedule is clear today to dedicate some time to it!

Inspiring
February 1, 2017

So here's where I'm at:

I made my way down to step 10. I'm guessing that the button tool is no longer under "interactive objects" but under prepare form/button tool (box with "ok" inside)?

I created the button, added the javascript, changing the name to the name I gave my template (which I unchecked the eyeball on) and found that the button name that I assigned does not show up and when I click the button in preview mode, get the spinning wheel & acrobat crashes.

What I don't understand throughout all of this is the need for step 3 - add text field. I add a text box from the prepare form section, the close out of prepare forms? What is the point of the text box? I'm trying to understand the process.

JR Boulay
Community Expert
Community Expert
January 31, 2017

Hi.

This tuto is still OK.

There are some change in Acrobat DC UI but don't matters: just type the name of a tool in the Tools pane search field to find it.

Acrobate du PDF, InDesigner et Photoshopographe
Inspiring
January 31, 2017

I've been going through it and I must be doing something wrong because it's not working for me.

try67
Community Expert
Community Expert
January 31, 2017

You need to provide more information about what exactly is going wrong.