Copy link to clipboard
Copied
Hi
I have been reading through the treads and am just wondering if there is a way to have layering work for a full page in a pdf form?
I can set up a form using pages as templates and then deleting the spawned page, but this is a risk, in that I can't specifically specify that only the spawned page is deleted. If someone accidentally hits the delete button before adding the spawned page then the next page in the form, which is required, is deleted and you can't retrieve it unless you cancel out of the form and start again.
Is there a way to stop this from happening by changing the javascript to only delete the spawned page and no other pages in the form?
Or I would prefer to be able to show and hide pages that aren't needed like it used to do in Lifecycle, as deleting pages is problematic with users who don't know what they are doing.
Hence my reason for asking if layering can work on a whole page instead of certain areas of a page.
Copy link to clipboard
Copied
Info: Users with Acrobat Reader can only delete spawned pages.
Copy link to clipboard
Copied
"but this is a risk, in that I can't specifically specify that only the spawned page is deleted. If someone accidentally hits the delete button before adding the spawned page"
Your button is not correctly JavaScripted otherwise there would be no risk of error.
How many static pages contain your document and how many spawned pages?
Is it spawned at the end of the file?
What is the script used?
Copy link to clipboard
Copied
I worked out what I was doing wrong. I was trying to delete the spawned pages from outside the spawned page itself. so I moved the delete button to the template so when the spawned page appears then you only delete that one page.
Copy link to clipboard
Copied
You can delete a spawned page from any other page in the file. That's not the issue.
Copy link to clipboard
Copied
I have 6 static pages and 6 spawned pages (the 6 spawned pages appear between pages 2 & 3 of the static ones.
I deleted the javascript I was using to try and delete the spawned pages, but I remember it was around using page numbers where the first page = 0. Does that make sense?
Copy link to clipboard
Copied
Not really, no. Like I said, it doesn't matter from where you run the code. If you're deleting a spawned page it should work from anywhere. Share your file for further help with this.
Copy link to clipboard
Copied
The first page has the number 0, the second page the number 1, and so on.
Copy link to clipboard
Copied
"I have 6 static pages and 6 spawned pages (the 6 spawned pages appear between pages 2 & 3 of the static ones. "
So your JavaScript must first check the number of pages in the document before deleting any.
Is it the same template page that is spawned each time or are they different template pages?
Copy link to clipboard
Copied
JR they are 6 different templates, but I worked out how to do it using the following javascript attached to a checkbox:
Copy link to clipboard
Copied
You should use something like this:
if(event.target.value == "Off")
if (this.numPages > 6) {this.deletePages(2,7);}
else {
if (this.numPages == 6) {
var a = this.getTemplate("Excursion");a.spawn(2,false,false);
var b = this.getTemplate("Catering");b.spawn(3,false,false);
var c = this.getTemplate("Boarding");c.spawn(4,false,false);
var d = this.getTemplate("Bus");d.spawn(5,false,false);
var e = this.getTemplate("Budget");e.spawn(6,false,false);
var f = this.getTemplate("Facilities");f.spawn(7,false,false);
}
}
Copy link to clipboard
Copied
Thanks JR that makes more sense and is safer :).