Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Feb 06, 2023 Feb 06, 2023

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

 

TOPICS
PDF forms
2.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 06, 2023 Feb 06, 2023

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 06, 2023 Feb 06, 2023

Can you tell me how the javascript would look like?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 06, 2023 Feb 06, 2023

But that won't work if the file is used in Reader. It's better to create Templates from all the pages in advance, and then spawn copies from them.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 06, 2023 Feb 06, 2023

Create templates for all pages.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 06, 2023 Feb 06, 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? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 06, 2023 Feb 06, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 06, 2023 Feb 06, 2023

Thanks for the replies and clarification!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 28, 2023 Feb 28, 2023

Can templates have more than one page?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 28, 2023 Feb 28, 2023

No.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 01, 2023 Mar 01, 2023
LATEST

Thank you! 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines