Expand my Community achievements bar.

Acrobat Designer -Show/Hide/Delete Pages

Avatar

Former Community Member
I have a PDF that is built in Designer 7.0.41126, it has 3 static data capture pages and 6 dynamic pages that are set to hidden at the begining of the process. Once the user captures the data they click a generate button and the script makes the pages visible based on the data entered. This works great and based on the data the document can grow up to 16 pages.



The first issue I have is that if you save the document in Acrobat 7 Professional (not reader) and re-open the document the dyanamic pages are hidden again and you only have the 3 static pages. Is there anyway to make the dynamic pages stay visible?



The second issue is that I want to be able to delete the data capture pages so the user can send the document to a customer without the data capture pages. I read that the javascript funtion deletepages does not work in a Designer 7 document. Any suggestions? The customer will more then likely be using reader to view the document.



Thanks in advance.
6 Replies

Avatar

Former Community Member
I'm trying to figure out a clean way to do this same thing. Any solutions?

Avatar

Level 6
I think there is more than one way to do what you want to do, but most of those methods are fairly tricky, and involve programatically manipulating the data DOM. Before going down that road, there may be a simpler way, but first I have a couple of questions. How are you doing the show/hide of the dynamic pages? Do these dynamic pages have merged data?

Avatar

Former Community Member
My form contains a static 7 page entry form which populates a 30+ page contract. When the user is done entering data, I want the 7 page entry form to disappear. I am currently using formPage.presence = "hidden";.



I can make the hidden status persist through saving and re-opening by using a hidden variable (isHidden) that gets checked when the form loads. If isHidden == 1, then the entry form is hidden again.



I would prefer to outright delete the entry form. My problem with the ".presence = hidden" method is that it always seems to leave at least one blank page where the entry form used to be.



Unlike Bob, I'm not trying to initially hide the body pages (the contract in my case).



Thanks

Avatar

Former Community Member
I solved the problem I had with the blank page. If some one else is having it, search the forum for "extra page" and you'll find several threads. In my case the dimensions for a page had been switched from inches to millimeters and exceeded 8.5 X 11 inches. I could tell which page was causing the problem by zooming out in the "Body Pages" tab and finding a page with a black border extending beyond the white content area. I fixed it by viewing the xml source, finding the offending page, and manually changing the height and width back to 8.5 x 11.

Avatar

Former Community Member
I believe the issue here is with the "hidden" trait. The way I resolved this several months ago, is I began to use setInstances. I recently posted some code for another person on this, so if you search through my posts, you should find it.



I think once you start doing that, you'll find things work better. I know this frustrated me for days and I couldn't really find it documented anywhere.



take care,

lisa

Avatar

Former Community Member
> and involve programatically manipulating the data DOM.

I have gotten to the point were I want to manipulate the DOM. I want to delete large portions during runtime with javascript. Am I trying to delete "XML Source" or DOM (I'm not sure). Using the presence attribute is not sufficient any more because the file has gotten so large, the whole point of "deleting" pages is to shrink the file size.

I understand how to read XML source, and I understand JavaScript. I don't even know if what I want to do is possible. In a form with the xml source below, can I delete the subform node and all its children with javascript at runtime?

.....


...(page content)....

.......