These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Spawning and Deleting Template Pages

dwoodward
Registered: May 14 2007
Posts: 2

We are using Adobe Acrobat 7.0.9 Professional on Windows XP. We have a form with built in templates that can be spawned using the following format:
this.spawnFromTemplate(“CTemp”);
this.pageNum++;
We have put this code under a button so that the users can add template pages as needed. We have also put a button to delete pages and keep the page numbering intact. However, our problem comes when users delete pages from the Pages Tab instead of using the button. When pages from the middle of the document are deleted under pages tab instead of the button, the numbering will be off. (ie. All text fields on two pages are the same so data is duplicated across two pages) When more pages are added and we end up with two pages with all the fields having the same name. Is there anyway to avoid this? Or how can we reset the page number after deletion?

My Product Information:
Acrobat Pro 7.0.9, Windows
DuffJohnson
Expert
Registered: May 30 2006
Posts: 96
Basically, I would suggest you find a way to design around the need to delete pages in a template-driven document. You've discovered one of the basic problems with the method.

As to preventing users from using the Pages button to delete things... why not simply hide the Navigation Pane altogether? Unless you need the thumbnail view for navigation, try simply turning off the Window Controls in that PDF.

Duff Johnson
w - http://www.duff-johnson.com
t - http://www.twitter.com/duffjohnson

djfixxx
Registered: Mar 22 2007
Posts: 111
Make a template of your page and give a name such as "Model"

With a button on your form or by console or bookmark try this code :

To hide :

var t =this.getTemplate("Model");
t.hidden = true;

To unhide :

var t =this.getTemplate("Model");
t.hidden = false

It professional, networking, technical, graphical, imaging, froms.

DuffJohnson
Expert
Registered: May 30 2006
Posts: 96
Hi,"djfixxx".

Your idea works in Acrobat Pro, but not in Reader. See Template (page 700) in the JS Reference.

I should have made this clear in my initial response. Thanks.

Duff Johnson
w - http://www.duff-johnson.com
t - http://www.twitter.com/duffjohnson