Skip to main content
Participant
February 6, 2023
Question

Button to copy current page + content and place in back of PDF form

  • February 6, 2023
  • 2 replies
  • 2738 views

Hello Community,

 

I've created an editable PDF form with a button to "Add page" and uses the following javascript:

 

var a = this.getTemplate("MyTemplate");
a.spawn({nPage: pageNum + 1, bRename: true, bOverlay: false});

 

The problem is that it copies only the first page (which you created a template of), where I'd rather have to "copy" the current page and content and place it as last page.

 

My question is: is it possible to create a template of the current/last page (incl. content) and place it in the back of the document?

 

Thank you in advance.

Kind regards,

JS

 

This topic has been closed for replies.

2 replies

Bernd Alheit
Community Expert
Community Expert
February 6, 2023

Create templates for all pages.

Participant
February 6, 2023

The forms stays the same but the content varies.

 

Use case would be that the user:

- navigates to last page

- presses "Add page"

- edits newly spawned page

- saves document

 

It's a continuous process, so creating templates is not an option. Unless it's scripted in the mouseclick action of "add page". Something like create template and then directly spawn template or just copy last/current page and place it in the back of the document.

Do you know how to do this? 

try67
Community Expert
Community Expert
February 6, 2023

You can only do that if all the users have Acrobat, and you can install a script file on their local computers in advance.

Nesa Nurani
Community Expert
Community Expert
February 6, 2023

You can create a template using 'createTemplate()' and then spawn it, but it can only be executed during a batch or console event.

Participant
February 6, 2023

Can you tell me how the javascript would look like?