Hide 1 page with checkbox on first page

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

99

Likes

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

Hide 1 page with checkbox on first page

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

100

Likes

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

Likes

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
Reply
Loading...
Jun 30, 2020 0
Jun 30, 2020

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Jun 30, 2020 1
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? 

Likes

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
Reply
Loading...
Jul 01, 2020 0
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.

Likes

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
Reply
Loading...
Jul 01, 2020 0
Jun 30, 2020

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Jun 30, 2020 1
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.

 

Likes

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
Reply
Loading...
Jul 01, 2020 1
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..

 

Likes

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
Reply
Loading...
Jul 01, 2020 0
Jul 01, 2020

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Jul 01, 2020 0
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

 

 

Likes

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
Reply
Loading...
Jul 01, 2020 0
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;
	}
}

Likes

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
Reply
Loading...
Jul 01, 2020 1
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

 

 

Likes

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
Reply
Loading...
Jul 01, 2020 0
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.

Likes

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
Reply
Loading...
Jul 01, 2020 1
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"

 

   

Likes

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
Reply
Loading...
Jul 01, 2020 0
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.

Likes

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
Reply
Loading...
Jul 01, 2020 1
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

 

Likes

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
Reply
Loading...
Jul 01, 2020 0
Jul 01, 2020

Copy link to clipboard

Copied

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

 

Likes

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
Reply
Loading...
Jul 01, 2020 0