Skip to main content
Inspiring
February 21, 2017
Answered

Save layer state on close

  • February 21, 2017
  • 1 reply
  • 7207 views

Hi

I have a relatively complicated form that is using buttons to show/hide multiple layers.

Everything is working well, but I am trying to find a way for the layer visibility state to be saved when the file is saved, so that when the PDF is next opened the layers are still in the same state.

Is this possible?

This topic has been closed for replies.
Correct answer Karl Heinz Kremer

You will have to save the layer state in e.g. a hidden form field and then restore it again from that hidden field the next time the document is opened. There is nothing built into Acrobat that would do this for you.

1 reply

Karl Heinz  Kremer
Community Expert
Karl Heinz KremerCommunity ExpertCorrect answer
Community Expert
February 21, 2017

You will have to save the layer state in e.g. a hidden form field and then restore it again from that hidden field the next time the document is opened. There is nothing built into Acrobat that would do this for you.

flaming1Author
Inspiring
February 21, 2017

Thanks Karl

I suspected that would be the case, but I'm not sure where to look for an example of how to script this.

Are you able to point me to any examples?

Karl Heinz  Kremer
Community Expert
Community Expert
February 21, 2017

Take a look here for some inspiration: Turn layer on/off AND save layer state (Edit PDF)