Friday, 26 April 2013

PDF tricks

Tips and Tricks for Creating PDF Buttons
The following list isn’t exhaustive, but, no doubt, those reading it can suggest some other tips:
1. When possible, create buttons on master pages in a document. This will greatly reduce the number of buttons you need to create, and will ensure consistency.
2. Buttons can have different attributes for visibility and printability. In the PDF language, buttons are considered a kind of field (think form fields). Fields can have four variations of visibility—Visible in the PDF, Visible in PDF but Doesn’t Print, Hidden in PDF, and Hidden in PDF but Printable. You can choose which of these attributes are applied to a button from the Button panel menu. Most buttons are Visible in the PDF but each of these options has their uses.  (Example: If you want a picture to appear when you click a button, create two buttons. Place the picture in a Hidden button, and use the Show/Hide Button action in the Visible button to make the picture visible.)
Button Panel menu
3. Buttons only “come alive” in an interactive PDF file if you turn on the right options when you export your PDF. (Forget trying to create a PDF using Distiller; that kills everything.) In the Export PDF dialog, be sure to check Interactive Elements (and also check Hyperlinks if you’re using those in your interactive PDF file).
PDF Export options
4. If you’re using transparency in your document and it in anyway interacts with a button, you must save your file with Acrobat 5 compatibility or higher (no transparency flattening). Otherwise, you’ll get the message below, and you’ll lose your interactivity:
Choose Acrobat 5 or later
Creating a Go to Page Button in a PDF File
As I mentioned in the previous posting, there is a Go to Page action in the Button panel in InDesign CS4, but it’s only for creating buttons to be exported as a SWF file. So how do you create one in a PDF file? You need to create a text anchor, and use the Go to Anchor action. (As we’ll see, these have a different name—named destinations—in Acrobat.) Here’s how to do it:
1. Go to the destination page, and select text in a text frame. (You could make text Paper color to hide it if you don’t want it to be visible.)
2. Open the Hyperlinks panel (Window > Interactive > Hyperlinks). Choose New Hyperlink Destination from the panel menu. By default, it names the text anchor it creates using the text string you selected, although you could rename it.
Create Text Anchor
3. Make a button, and make its action Go to Text Anchor. Select the text anchor you created.
Select Text Anchor
When an interactive PDF is created, that should create a named destination that the button will select, jumping to the appropriate page.
Button Troubleshooting in Acrobat
We’d expect that all the buttons we create in InDesign would create perfect buttons in Acrobat. Unfortunately, many things can go wrong. In fact, as I was preparing this posting, I ran into one myself. So I’ll use it as an example of how to troubleshoot buttons in Acrobat. When I created a text anchor as I described above and made a PDF, all my buttons worked correctly except that one. As of this writing, I’m not sure what happened (my colleague and friend Sandee Cohen wasn’t able to replicate the problem). I did the requisite troubleshooting (like restoring my InDesign preferences) but the problem persisted. The method worked correctly in InDesign CS3 so it could be a subtle InDesign CS4 bug.
I opened up Acrobat to see what was going wrong. Acrobat has had its own interface for creating and editing buttons for many versions. In many ways, it can create buttons which are more complex than those that can be created in InDesign so it’s worthwhile to learn how it works.
I worked in Acrobat 9 Pro which now has a special form editing mode, and I’ll give the steps I followed, but I’ll also describe how I could use Acrobat 8 Professional as well. I ended up editing the named destination (text anchor).
1. Choose Forms > Add or Edit Fields (In Acrobat 8 Pro, choose Forms > Edit Form in Acrobat.)
2. Find the button which is not working. You can use the Fields panel at the left to help identify it, if necessary. Double-click the button. (In Acrobat 8 Pro, the Forms toolbar opens. Click the Button tool, and double-click the problem button.)
3. The Button Properties dialog box opens. Click the Actions tab.
Acrobat 9 Button Properties
4. In the Actions section at the bottom, select Go to a page in this document. Click the Edit button.
Editing the Named Destination
Now you can see that the text anchor (now called a Named Destination) is embedded in the PDF file. Browse to reselect it again, and click OK.
5. Close the dialogs. Click Close Form Editing (Acrobat 9 Pro only).
After reselecting the destination, the button worked fine.
What if you needed to create a new destination in Acrobat? You’d use Acrobat’s Destinations panel. Here’s how:
1. Choose View > Navigation Panels > Destinations
2. Navigate to the page you’d like to make the destination.
3. Choose New Destination from the Action popup menu (gear icon).
Acrobat Destination Panel
A new destination is created. You’re given the opportunity to name it. It’s set to the page you’re currently viewing.
4. Edit your button to select the new destination you created.


Post a Comment