Skip to main content
Participant
March 20, 2022
Question

Spawning Pages with layers - reset fields and visibility

  • March 20, 2022
  • 2 replies
  • 638 views

Please help! I am currently creating a form in Adobe Acrobat Pro. I have a page where I have created "add" and "remove" buttons to add and remove fillable boxes using laters and show/hide field actions.

 

When I use this page as a page template to add additional pages, the editable fields copy over and the visibility doesn't copy over and reset.

 

My knowledge of javascript is VERY limited, and I have been searching the internet for solutions to no avail. 

 

Question 1: How do I spawn the page and have the fields reset?

Question 2: Can I get the layers to copy over and reset when the page is spawned?

 

Is there a way to make this work? I am happy to receive suggestions! Or as a work around, should I have preset pages that they can delete if they are not needed?

 

 


B

 

This topic has been closed for replies.

2 replies

JR Boulay
Community Expert
Community Expert
March 21, 2022

1. You should use a hidden page template, and the first page of your document should be a (already) spawned page. This way you won't have this issue (assuming that the bRename parameter is set to true).

 

2. Spawning layered pages is not possible since layers are flatenned during the spawn. But you can spawn another template over an existing page.

See the bOverlay parameter in this page: https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/html2015/Acro12_MasterBook/JS_API_AcroJS/Template_methods.htm?rhhlterm=spawn&rhsyns=%20

 

3 (Workaround).

It is often easier to delete useless pages than to generate useful ones.

But beware, Acrobat Reader cannot delete "normal" pages, it can delete spawned pages only.

Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
March 20, 2022

1. You have to do that manually. You can write a function to collect all the fields from a certain page and then reset them.

2. Not possible.