These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Problem setting OCG (layer) visibility

davidwesten
Registered: Apr 29 2009
Posts: 6

I have a problem which is driving me absolutely crazy. I will be very grateful if anyone can provide help!

I have a form application that uses Javascript to toggle the visibility of several layers (OCGs). I have a function to find an OCG by name, and then I am changing the state property to change visibility.

The problem is that the layer visibility does not change. I have confirmed that the OCG is being found, and that the state property is being changed correctly (using the Javascript console). The visibility simply doesn't match the state.

I have also confirmed that all layers are set to "Visible when on".

The strangest thing is that this was working fine in earlier versions of the document, using nearly identical code. It stopped working at some point, and I haven't been able to figure out why.

Anyone who can help is my new hero!

My Product Information:
Acrobat Standard 8.0, Macintosh
davidwesten
Registered: Apr 29 2009
Posts: 6
Ok, I think I may have found the root of the problem.

It appears that there are some kind of weird duplicate OCGs in the document. I wrote some code to output all of the OCGs, and there are several repeats (these do not appear in the layers list in Acrobat).

I created these by importing an Adobe Illustrator document.

Anyone come across a problem like this?