Acrobat checkbox off to hide a spawned page

New Here ,
May 27, 2022 May 27, 2022

Copy link to clipboard

Copied

Sorry for the continued questions, I'm hoping this will the last one

 

I curently have a checkbox set up to spawn a template using the below, so when you click it, it spawns a template after a specified page

 

this.getTemplate("Section1").spawn(this.getField("Marker1").page+1, true, false);

 

I want it to remove this page though when you uncheck the box, is that doable?

 

Thanks for any help! 

TOPICS
Acrobat SDK and JavaScript

Views

47

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

correct answers 1 Correct answer

Adobe Community Professional , May 27, 2022 May 27, 2022

Sure. Try this:

 

if (event.target.value!="Off")

this.getTemplate("Section1").spawn(this.getField("Marker1").page+1, true, false);

else this.deletePages(this.getField("Marker1").page+1, this.getField("Marker1").page+1);

Likes

Translate

Translate
Adobe Community Professional ,
May 27, 2022 May 27, 2022

Copy link to clipboard

Copied

Sure. Try this:

 

if (event.target.value!="Off")

this.getTemplate("Section1").spawn(this.getField("Marker1").page+1, true, false);

else this.deletePages(this.getField("Marker1").page+1, this.getField("Marker1").page+1);

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 ,
May 27, 2022 May 27, 2022

Copy link to clipboard

Copied

LATEST

Thankyou again, perfect! 

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