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

How do I build a button that creates a new blank page with Acrobat XI

New Here ,
Jul 18, 2018 Jul 18, 2018

How do I build a button that creates a new page with the same format but the data is blank? i.e. I used the JavaScript command "var.a=this.getTemplates("Second Page");a.spawn();" and it creates the new page, but it copies over all the data from that page into the new page....I want the new page to be blank (with the same formatting)...what do I need to change to the code?

TOPICS
Acrobat SDK and JavaScript , Windows
848
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 ,
Jul 18, 2018 Jul 18, 2018

You need to specify the bRename parameter of the spawn method as true, and then you need to reset all the fields on the newly created page. Either that or use a (hidden) Template page with empty fields and spawn the new pages from it.

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 ,
Jul 18, 2018 Jul 18, 2018

Thanks! Do you have the bRename parameter of the spawn as true code? Thanks!

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 ,
Jul 18, 2018 Jul 18, 2018

Correct.

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 ,
Jul 18, 2018 Jul 18, 2018

What's the code? Mine doesn't work...Add Page JavaScript.png

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 ,
Jul 18, 2018 Jul 18, 2018

You have an error in your code: Remove the 3 from "num3Pages".

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 ,
Jul 20, 2018 Jul 20, 2018

So I fixed the error in the code (removed the 3)...however, the add page keeps data from the earlier page...I'm trying to get the page to be blank...seems like bRename isn't working?

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 ,
Jul 20, 2018 Jul 20, 2018
LATEST

The spawn method doesn't clear the fields, even if they are renamed. You will need to do that yourself.

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