Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Layer Control in Adobe Reader
  FAQ FAQ  Forum Search   Register Register  Login Login


Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Layer Control in Adobe Reader

 Post Reply Post Reply
Author
drsebast View Drop Down
New Member
New Member


Joined: 30 Jan 2012
Location: Ohio, US
Points: 2
Post Options Post Options   Quote drsebast Quote  Post ReplyReply Direct Link To This Post Topic: Layer Control in Adobe Reader
    Posted: 30 Jan 2012 at 4:00pm
Is it possible to control the visibility of a layer in a pdf from a pushbutton control in that pdf?

I have a mapping pdf with 8 layers, each showing a different type of symbol.  The legend on the page shows all of the layers and symbols.  I would like to have a button (check box type would be great) next to each legend item to allow that layer to be turned off or on after clicking.

I am not familiar with javascript and was refered here by the Debenu Customer Service people so some code samples would be a great assistance.

Thanks in advance.
Don
Back to Top
Sponsored Links


Back to Top
drsebast View Drop Down
New Member
New Member


Joined: 30 Jan 2012
Location: Ohio, US
Points: 2
Post Options Post Options   Quote drsebast Quote  Post ReplyReply Direct Link To This Post Posted: 30 Jan 2012 at 7:22pm
Thanks for the chance to post this question.  I overlooked the old forum and archive links above.  I did find a similar question and it had a script that I could modify.  Works fine.

var docOCGs = this.getOCGs();
for (var x=0; x < docOCGs.length; x++)
{
if(docOCGs[x].name == "Layer 2")
{
docOCGs[x].state = !docOCGs[x].state;
}
}


I found it in the old forum in "JavaScripting in PDF's" by bk80.






Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.031 seconds.