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

114

Likes

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
Most Valuable Participant ,
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.

Likes

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!

Likes

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

Copy link to clipboard

Copied

Correct.

Likes

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

Likes

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

Copy link to clipboard

Copied

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

Likes

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?

Likes

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
Most Valuable Participant ,
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.

Likes

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