How to build a button that creates a new page in Acrobat Pro DC?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I've been going through it and I must be doing something wrong because it's not working for me.
Copy link to clipboard
Copied
You need to provide more information about what exactly is going wrong.
Copy link to clipboard
Copied
I have successfully created a template to spawn a page when a button is clicked. I have 2 pages to start with and when the button is clicked, it appears as the 3rd page. I would like it to appear as the second page. How can I control where the spawned template page appears?
Copy link to clipboard
Copied
Change the value of the nPage parameter in your spawn command.
Copy link to clipboard
Copied
How exactly do I do that with the following code?
this.getTemplate("page1").spawn({nPage:this.numPages, bRename:true, bOverlay: false});
Copy link to clipboard
Copied
Change:
nPage:this.numPages
To:
nPage:this.numPages-1
Copy link to clipboard
Copied
That worked perfect. THANK YOU.
Copy link to clipboard
Copied
So I have successfully created the button to add a new page and I have tested it all in Bluebeam Revu on my computer and it works well. Although the program I want to use this for is PDF Expert by Readdle on iPad and I just tested it on there and the buttons did nothing.. What can I do to get this to work with this program?
Copy link to clipboard
Copied
Probably nothing. You can contact Readdle and ask them to implement this feature.
Copy link to clipboard
Copied
tool"Forms Edit" is now "Prepare Form" tool
"Templates" is located in the "Organize Pages" tool under "More => Page Templates".
The JavaScript remains unchanged.
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
another update: started from scratch. I found that only the page that I designate as the template will allow me to place a button on it (so i cannot turn off that page then, right?). Still cannot get text to show up inside the button or change the font size in the button in the properties window.
Still crashes overtime I go to preview and click the button.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
You will find another great tuto for creating new pages here: http://abracadabrapdf.net/ressources-et-tutos/js-et-formulaires-ressources/dupliquer-dynamiquement-d...
(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)
.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Also the example document links don't work on my end.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Did you read the tutorial?
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I have the Rename set to true.
Here is an example of what I get:
It does rename the fields but the information still carries over.
I do get the following message when I add a page as a template:
Any form fields that have the same name in the merged documents are now merged into one field. If you want the values in these fields to be unique, then you need to create a PDF Portfolio instead of merging the files. To create a PDF Portfolio, choose File > Create PDF Portfolio.
Which totally confuses me.
![](/skins/images/EAF9F7E131C5D03B206D7C6CFC7D852B/responsive_peak/images/icon_anonymous_message.png)
![](/skins/images/EAF9F7E131C5D03B206D7C6CFC7D852B/responsive_peak/images/icon_anonymous_message.png)
-
- 1
- 2