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

Acrobat Interactive PDF shows hidden layers randomly on opening

Community Beginner ,
Apr 28, 2022 Apr 28, 2022

Copy link to clipboard

Copied

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. 

TOPICS
Create PDFs , Edit and convert PDFs , General troubleshooting , PDF forms

Views

1.8K

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

correct answers 1 Correct answer

Community Expert , Apr 28, 2022 Apr 28, 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 pr

...

Votes

Translate

Translate
Community Expert ,
Apr 28, 2022 Apr 28, 2022

Copy link to clipboard

Copied

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.

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 ,
Apr 28, 2022 Apr 28, 2022

Copy link to clipboard

Copied

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.

 

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 ,
Apr 28, 2022 Apr 28, 2022

Copy link to clipboard

Copied

With a script hide the layers on document open.

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 ,
Apr 28, 2022 Apr 28, 2022

Copy link to clipboard

Copied

Don't know how to do that.

 

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 ,
Apr 29, 2022 Apr 29, 2022

Copy link to clipboard

Copied

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.

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 ,
Apr 29, 2022 Apr 29, 2022

Copy link to clipboard

Copied

Hidding all layers means hidding the "Content" layer too!

In any case, reinventing the wheel with a script is useless, as shown below.

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 ,
Apr 28, 2022 Apr 28, 2022

Copy link to clipboard

Copied

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.

 

Capture_346.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 Beginner ,
Apr 29, 2022 Apr 29, 2022

Copy link to clipboard

Copied

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

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 ,
Aug 23, 2022 Aug 23, 2022

Copy link to clipboard

Copied

LATEST

I wonder if you might help me again. Same kind of Interactive PDF that I am programming with layer visibility. In the preview, when a button is clicked and the next layer becomes visible, there is a box that remains visible where the button was. I cannot figure out how to get rid of this. Once you click somewhere else, it disappears. It happens with all buttons that reveal another layer, the outline of the button remails. See snippit image of what remains from a button clicked. Can you help?

 Screen Shot 2022-08-23 at 1.05.25 PM.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