Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
2

Show/Hide pages

Explorer ,
Sep 20, 2023 Sep 20, 2023

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.

TOPICS
PDF forms
1.9K
Translate
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
Community Expert ,
Sep 20, 2023 Sep 20, 2023

Info: Users with Acrobat Reader can only delete spawned pages.

Translate
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
Community Expert ,
Sep 21, 2023 Sep 21, 2023

"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?


Acrobate du PDF, InDesigner et Photoshoptographe
Translate
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
Explorer ,
Sep 21, 2023 Sep 21, 2023

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.

Translate
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
Community Expert ,
Sep 21, 2023 Sep 21, 2023

You can delete a spawned page from any other page in the file. That's not the issue.

Translate
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
Explorer ,
Sep 21, 2023 Sep 21, 2023

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?

Translate
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
Community Expert ,
Sep 22, 2023 Sep 22, 2023

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.

Translate
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
Community Expert ,
Sep 22, 2023 Sep 22, 2023

The first page has the number 0, the second page the number 1, and so on.

Translate
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
Community Expert ,
Sep 22, 2023 Sep 22, 2023

"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?


Acrobate du PDF, InDesigner et Photoshoptographe
Translate
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
Explorer ,
Sep 24, 2023 Sep 24, 2023

JR they are 6 different templates, but I worked out how to do it using the following javascript attached to a checkbox:

 

if(event.target.value == "Off")
   this.deletePages(2,7);
else
{
   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);
}

 

 

Translate
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
Community Expert ,
Sep 25, 2023 Sep 25, 2023

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);
}
}

 

 


Acrobate du PDF, InDesigner et Photoshoptographe
Translate
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
Explorer ,
Sep 25, 2023 Sep 25, 2023
LATEST

Thanks JR that makes more sense and is safer :).

Translate
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