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

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

New Here ,
Jul 18, 2018 Jul 18, 2018

Copy link to clipboard

Copied

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

Views

537

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Correct.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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