Copy link to clipboard
Copied
Is there a possibility to insert an empty page into a pdf form (by using js)?
Copy link to clipboard
Copied
This code will add a new page to the end of the current file:
this.newPage()
Does your file have form fields? If so, then it's a bit trickier.
You can do it by converting your form to a Template object and then spawning new copies of it.
One of the parameters is to rename the fields in the spawned pages.
Copy link to clipboard
Copied
Yes, using the newPage method of the Document object.
Copy link to clipboard
Copied
Could you please give me an example? ![]()
Copy link to clipboard
Copied
Or is it even possible too take my whole formular and add it a second time at the bottom?
Copy link to clipboard
Copied
This code will add a new page to the end of the current file:
this.newPage()
Does your file have form fields? If so, then it's a bit trickier.
You can do it by converting your form to a Template object and then spawning new copies of it.
One of the parameters is to rename the fields in the spawned pages.
Copy link to clipboard
Copied
I get this error:
NotAllowedError: Sicherheitseinstellungen verhindern den Zugriff auf diese Eigenschaft oder Methode.
Doc.insertPages:3:Field Button10:Mouse Up
Am I doing something wrong or might there be a security problem of my pc at work?
Copy link to clipboard
Copied
This is not the code I provided... Please post the full code, and specify from where you're executing it.
Copy link to clipboard
Copied
I'm seeing this is from a MouseUp event of a button field. You can't use the insertPages command from that context. Not directly, at least.
It requires a privileged context, which means you need to run it though a trusted function in a folder-level script.
See: https://acrobatusers.com/tutorials/trust-and-privilege-in-acrobat-scripts
Copy link to clipboard
Copied
I don't really understand where to place this. What User Javascript folder?

Copy link to clipboard
Copied
What's your version of Acrobat, and OS?
Copy link to clipboard
Copied
Acrobat Pro DC 18.009.20044 / Win 10
Copy link to clipboard
Copied
Then it should be something like:
C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Javascripts
This is the app folder, though, the user folder is more difficult to locate.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more