Skip to main content
Participant
April 28, 2022
Answered

Acrobat Interactive PDF shows hidden layers randomly on opening

  • April 28, 2022
  • 3 replies
  • 4130 views

I have created an Interactive PDF in Acrobat from layers exported from Indesign. I have created pop-ups using layer visibility. I have saved the PDF with all layers NOT visible, but when I open the PDF again, random pop-up layers are visible on open. How can I prevent layers that are turned off from becoming visible on open? In other words, they are programmed to turn on with button actions and need to remain turned off until activated.

I have opened the PDF, turned all the layers off and resaved many times, they always come back on when I open the file again. 

This topic has been closed for replies.
Correct answer JR Boulay

The visibility of PDF layers (aka OCGs) relies on 2 parameters :

 

- the "Visibility" which any user can edit by clicking on the eye icon to show/hide any layer or by clicking on a button as in your document. This parameter is never saved and layers reverts to their default state each time the document is closed.

 

- the "Default State" is the parameter that determines the starting visibility each time the document is opened.

That's the one you have to deal with.

 

You can also lock layers to prevent the user from making unwanted manipulations by clicking on the eye icons.

 

3 replies

JR Boulay
Community Expert
JR BoulayCommunity ExpertCorrect answer
Community Expert
April 29, 2022

The visibility of PDF layers (aka OCGs) relies on 2 parameters :

 

- the "Visibility" which any user can edit by clicking on the eye icon to show/hide any layer or by clicking on a button as in your document. This parameter is never saved and layers reverts to their default state each time the document is closed.

 

- the "Default State" is the parameter that determines the starting visibility each time the document is opened.

That's the one you have to deal with.

 

You can also lock layers to prevent the user from making unwanted manipulations by clicking on the eye icons.

 

Acrobate du PDF, InDesigner et Photoshopographe
Participant
April 29, 2022

That was the ticket!!! Thank you very much, simple and makes so much sense. 

Bernd Alheit
Community Expert
Community Expert
April 28, 2022

With a script hide the layers on document open.

Participant
April 28, 2022

Don't know how to do that.

 

Bernd Alheit
Community Expert
Community Expert
April 29, 2022

Hide all layers:

var ocgArray = doc.getOCGs();
for (var i=0; i < ocgArray.length; i++)
  ocgArray[i].state = false;

Then show the layer which you want display.

BarlaeDC
Community Expert
Community Expert
April 28, 2022

Hi,

 

Are you able to share the document ( or a sample that shows the problem) as it is probably just some of the code running when you are not expecting it too.

Participant
April 28, 2022

I have attached a few pages of the document that have layers that have "turned on" after turning them all off and saving. I'm using buttons with "layer visibility" options to hide and show the layers. They all should be hidden until "turned on" by button functions. For some reason, some of them turn themselves on when the file is opened.