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
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 😃
Copy link to clipboard
Copied
Acrobat Reader can't hide pages. It can delete spawned template pages.
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?
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.
Copy link to clipboard
Copied
Even if it was possible, if JavaScript is disabled it won't work...
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.
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..
Copy link to clipboard
Copied
Sry, I´m using PDF XChange Editor to create the document.
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
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;
}
}
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?)
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.
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"
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.
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:
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..