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

Hide 1 page with checkbox on first page

Community Beginner ,
Jun 30, 2020 Jun 30, 2020

Copy link to clipboard

Copied

Hi together,

is it possible to hide the first page of a pdf with a checkbox which is also located on the first page? Like kind of :"Dónt show me again". The first page gives the user the hint to activate JavaScript, my aim is to give them the possibility to check the checkbox to hide the first page with this hint..

 

Thanks in advance

Leo 

TOPICS
Acrobat SDK and JavaScript

Views

734

Translate

Translate

Report

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 Beginner ,
Jun 30, 2020 Jun 30, 2020

Copy link to clipboard

Copied

To be more detailled:

 

i put a text on the first page with the hint to activate JavaScript and three or for more sentences 😃

Votes

Translate

Translate

Report

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 ,
Jun 30, 2020 Jun 30, 2020

Copy link to clipboard

Copied

Acrobat Reader can't hide pages. It can delete spawned template pages.

Votes

Translate

Translate

Report

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 Beginner ,
Jul 01, 2020 Jul 01, 2020

Copy link to clipboard

Copied

This would be also possible for my document. What would be the code for the checkbox to delete the first page? 

Votes

Translate

Translate

Report

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 ,
Jul 01, 2020 Jul 01, 2020

Copy link to clipboard

Copied

First you must spawn the first page then you can delete this page.

It will only work when Javascript is enabled.

Votes

Translate

Translate

Report

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 ,
Jun 30, 2020 Jun 30, 2020

Copy link to clipboard

Copied

Even if it was possible, if JavaScript is disabled it won't work...

Votes

Translate

Translate

Report

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 ,
Jul 01, 2020 Jul 01, 2020

Copy link to clipboard

Copied

Don't use a page, you should use a layer to give the user the hint to activate JavaScript.

And you should use a JavaScript to hide this layer at document opening.

So, if JavaScript is already enabled the user will not see anything, and if JavaScript is not enabled the user will see the layer.

 

Votes

Translate

Translate

Report

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 Beginner ,
Jul 01, 2020 Jul 01, 2020

Copy link to clipboard

Copied

That sounds perfect!

I´ve never used a layer, can you give an example how to create one with Adobe Reader?

Is the code for the JavaScript difficult? I´m at the very beginning..

 

Votes

Translate

Translate

Report

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 Beginner ,
Jul 01, 2020 Jul 01, 2020

Copy link to clipboard

Copied

Sry, I´m using PDF XChange Editor to create the document.  

Votes

Translate

Translate

Report

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 Beginner ,
Jul 01, 2020 Jul 01, 2020

Copy link to clipboard

Copied

me once again...

 

I found out how to create a layer 😃 and named it "Welcome". How can I write my text on the layer (and propably provide a screenshot). What will the JavaScript Code look like to hide the layer if JavaScript is alredy enabled and vice versa. 

 

Sry I´m kind of exited to see the result, I still can´t imagine that I´ll be able to make this work.

 

Thanks in advance

 

 

Votes

Translate

Translate

Report

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 ,
Jul 01, 2020 Jul 01, 2020

Copy link to clipboard

Copied

You'll need to add the text in the authoring application. You can't do it in Reader.

This code can be used to hide a layer called "Welcome":

 

var ocgArray = this.getOCGs();
for (var i=0; i < ocgArray.length; i++) {
	if (ocgArray[i].name=="Welcome") {
		ocgArray[i].state = false;
		break;
	}
}

Votes

Translate

Translate

Report

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 Beginner ,
Jul 01, 2020 Jul 01, 2020

Copy link to clipboard

Copied

What do you mean with authoring application? I´m Sorry but I have no clue how do add the text in the layer. Thanks for the code, I put it in the JavaScript (is this correct?)

PDF.PNG

 

 

Votes

Translate

Translate

Report

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 ,
Jul 01, 2020 Jul 01, 2020

Copy link to clipboard

Copied

This application. The one you used to create the file and add the layer to it.

I don't know if this is the right location for the code. It looks like it, though.

Votes

Translate

Translate

Report

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 Beginner ,
Jul 01, 2020 Jul 01, 2020

Copy link to clipboard

Copied

Okay, last question from above:

 

Can you help me how I can add text to the layer with using pdf xchange editor (Version 8.0.0336.0000)? I can´t find anything on google... I feel super stupid but I just don´t see the possibility to create the layer

 

"Hello you haven´t activatated JavaSript yet. Please go to Settings > JavaScript and tick the checkbox"

 

   

Votes

Translate

Translate

Report

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 ,
Jul 01, 2020 Jul 01, 2020

Copy link to clipboard

Copied

Sorry, I can't. See if there are forums for that application where you can ask for help... I can help you to do it in Acrobat, though.

Votes

Translate

Translate

Report

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 ,
Jul 01, 2020 Jul 01, 2020

Copy link to clipboard

Copied

When Javascript is not enabled users of Acrobat Reader DC will get following information when they open documents with Javascript code:

Bild1.jpg

 

Votes

Translate

Translate

Report

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 Beginner ,
Jul 01, 2020 Jul 01, 2020

Copy link to clipboard

Copied

LATEST

Thought so too but when i deactivate JavaScript in Acrobar Reader DC and open the pdf which has different JavaScript codes, nothing appears..

 

Votes

Translate

Translate

Report

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