Buttons on Adobe PDF Layers
If you create a PDF document with Adobe PDF layers such as exporting layered files from Illustrator or Adobe InDesign and add a button field to the PDF, the button appears on each layer. It’s like the button has it’s own layer and you can’t assign a button field to a specific layer. This can present some problems if you want to use buttons to show/hide layers and invoke actions such as showing videos or playing sounds. If the buttons are accessible no matter what layer is in view, you have to be careful with your design so the user won’t inadvertently click the wrong button.
Take Figure 1 as an example. The showVideo button opens the video layer where a video can be played. The play buttons are left of the button that brings the video layer in view. The proximity of the buttons can be confusing if a user wants to click the Stop button and accidently clicks the showVideo button. Since the buttons are visible on all layers, you need to create a workaround to help the end user avoid confusion.
Figure 1
A workaround in previous versions of Acrobat was to add a Show/Hide action that hides buttons that should be assigned to layers not visible in the present view. When you change a layer view, you had to go about showing the buttons on the layer where you want to invoke actions respective to the visible layer.
A better way to handle the problem is to assign buttons to specific layers. However, you cannot do that in Acrobat. But fortunately with a little help with InDesign CS3, you can add buttons to individual layers that are shown with the layer visibility in Acrobat. If the layer with a button is not visible, the button along with the design elements remain hidden.
Here’s how to do it.
Open InDesign and create your layout. Draw a rectangle with the Rectangle Tool. It doesn’t matter what size you draw or apply borders or fills to the button. The size and appearance settings can be changed in Acrobat.
Select one of the rectangles you drew and open the Object menu and choose Interactive > Convert to Button. Convert each rectangle to a button that you want to appear as a button field in Acrobat. Change layer views and add more rectangles and convert to buttons. The buttons you create on layers in InDesign will be visible in Acrobat only when the given layer is in view.
When you export to PDF be certain to check the checkboxes for Create Acrobat Layers and Interactive Elements in the Export to Adobe PDF dialog box. (See Figure 2).
Figure 2
In Acrobat you can change the appearance and size of the buttons. Although InDesign is limited in the number of different actions you can assign to a button, you can change all actions in Acrobat. For example, InDesign doesn’t provide an option to Run a JavaScript. However, just use the Select Object tool in Acrobat and double click a button you created in InDesign and you can select any action that Acrobat provides you including Run a JavaScript. Changing size, appearance and actions won’t affect the layer assignment you made in InDesign.
Another nice feature you have in InDesign is creating several more shapes than the single rectangle object you draw with Acrobat’s Button tool. Create a rectangle in InDesign and open the Object menu. Choose Convert Shape and a submenu opens with nine different options for an object appearance as shown in Figure 3. Any one of these objects can be converted to a button and the button appearance is shown in Acrobat.
Unfortunately you can’t change button appearances on objects other than rectangles in Acrobat. If you want a border color and/or fill applied to the button shape for all buttons other than a rectangle, you need to add the appearances in InDesign. Figure 3 shows the options choices you have in InDesign with borders and fills applied before exporting to PDF.
Figure 3
What about Text fields? Unfortunately we don’t yet have an option in InDesign to convert a text frame to an Acrobat text form field. Any fields you create in Acrobat will be visible on all layers.
August 12th, 2007 at 8:44 pm
[…] Adding Buttons to Layers in Acrobat I just finished a blog post on my other blog site for describing how you can add button fields to Acrobat layers that only appear on the visible layer. If you create a field on a layered PDF document in Acrobat, the field is visible on all Acrobat layers. To learn how to create button fields that can be shown and hidden using Acrobat’s Layers panel, check out my blog post at my Acrobat User Web site. […]
October 23rd, 2007 at 6:04 am
“A better way to handle the problem is to assign buttons to specific layers.”
I had the same problem and finally wrote an Acrobat plug-in to handle this for all types of form fields. I made the plug-in freely available:
http://www.cptec.de/blogit/CPTecLayerPluginForAcrobat.aspx