Skip to main content
Inspiring
May 27, 2020
Answered

Is it possible to hide or show certain pages according to certain conditions?

  • May 27, 2020
  • 2 replies
  • 1945 views

The question is the same as the subject.  Is it possible to hide or show certain pages according to certain conditions ?  Of course using JavaScript.

This topic has been closed for replies.
Correct answer yukinohana

I'm sorry. I found the following page after a question. I understood that it was impossible.

https://community.adobe.com/t5/acrobat/show-and-hide-pages-via-javascript-api/td-p/10359058?page=1

2 replies

Joel Geraci
Community Expert
Community Expert
May 28, 2020

You can effectively show and hide pages in a PDF by creating a Template for each page that you want to show or hide. To function properly in both Acrobat and Reader, hidden pages can be spawned to the end or to a specific page number in the file. Spawned pages can then be "deleted" which only deletes the spawned duplicate of the template page which will still exist to be spawned again when needed.

To "show"a page use...

 

this.getTemplate("myTemplate").spawn();

 

  

Inspiring
June 7, 2020

Thankyou for your reply. I will keep this knowledgement in mind for the future.

 

But this time I don't want to use it as a template. I want to make an existing page entered by the user unnecessary for the final result according to the input conditions and hide it instead of deleting it.  But I really appreciate your advice.

Bernd Alheit
Community Expert
Community Expert
June 7, 2020

You can save the form data entered by the user and delete the page.

yukinohanaAuthorCorrect answer
Inspiring
May 27, 2020

I'm sorry. I found the following page after a question. I understood that it was impossible.

https://community.adobe.com/t5/acrobat/show-and-hide-pages-via-javascript-api/td-p/10359058?page=1