Skip to main content
Participant
February 4, 2025
Answered

Interactive button to show and hide layers

  • February 4, 2025
  • 2 replies
  • 1828 views

Hello! I am hoping someone can help me please with interactive buttons!

 

I have created a map that has different layers for each service we have in that area  - all created in Indesign. The final aim is to have an interactive PDF. 

 

I wanted the user to be able to click a button in a key to show a layer/ particular service and unclick it to turn it off if needed. 

 

How do I do this? I have tried creating buttons but can't see an easy way to show layers as an action?

Correct answer Jeffrey_Smith

There is a workaround method that uses two buttons (placed over top of each other).

1. first button shows the map, shows the hide button, hides itself.

2. then the second button hides the map, shows the first button, hides itself.

Files are attached to demonstrate

2 replies

Robert at ID-Tasker
Legend
February 5, 2025

It's be possible - but would require injecting JavaScript in Acrobat. 

 

TᴀW
Legend
February 4, 2025

It should be possible. You need to create a button in InDesign, then add an action ("Show/hide buttons and forms"), and you get this:

 

Visit www.id-extras.com for powerful InDesign scripts that save hours of work — automation, batch tools, and workflow boosters for serious designers.
Participant
February 4, 2025

Thank you - so I created a box and made it a check box button, you can click it and it will show the layers but do you know how I get it to hide them again when the box/button is unclicked?

TᴀW
Legend
February 5, 2025

That's a good question. I was playing around with it a little and I'm not sure.

All I can think of (untested) is to create two superimposed checkboxes. Clicking on one causes it to hide itself and show the other, and vice versa. That way you provide different visibility configurations for each checkbox.

But I think what Adobe intended (if they intended anything at all), or, at least, the simplest option, is to create two buttons side by side. One should be labelled "Show Map" (or whatever it is you're showing), and the other "Hide Map". At that point it is easy to show and hide layers depending on which button has been clicked.

Visit www.id-extras.com for powerful InDesign scripts that save hours of work — automation, batch tools, and workflow boosters for serious designers.