Creating Navigation Buttons and Full-Screen Viewing

By Ted Padova – February 19, 2007

 

Last week I talked about creating navigation buttons to move forward and backward in a PDF document. Once you create the navigation buttons, the next step is setting up the document for viewing. There’s no need to add buttons to documents that open in default views. However, if you want to provide more viewing area for PDF pages, you can hide the toolbars or open documents in full-screen views.

Let’s look at hiding the Toolbar Well. Follow these steps to hide toolbars when a document opens in an Acrobat viewer:

  1. Create a document-level JavaScript. Open the PDF where you created the navigation buttons and select Advanced > Document Processing > Document JavaScripts.
  2. Type a name for the script. The JavaScript Functions dialog box opens; click the Add button (see Figure 1) to open the JavaScript Editor.

Figure 1

  1. Add a JavaScript. Type the following code in the JavaScript Editor.

app.toolbar = false;

  1. Click OK in the JavaScript Editor and click Close in the JavaScript Functions dialog boxes.

This document-level JavaScript executes when the PDF file opens. The simple, one-line script hides the toolbars and, by extension, hides the Toolbar Well.

One problem users may have is that once the toolbars are hidden, they remain hidden in the current Acrobat session. If a user opens your file where the Document JavaScript hides the toolbars, closes your file and then wants to browse other PDFs, no toolbars are in view. A user can always press F8 to show toolbars, but not every user will know this.

As a courtesy to users viewing your PDFs, be sure to show the toolbars when your file closes. You can easily do this by adding a JavaScript to a Document Action. Here’s how:

  1. Open the Document Actions dialog box. Select Advanced > Document Processing > Set Document Actions.
  2. Add a JavaScript. Click the Document Will Close item and click Edit to open the JavaScript Editor. Add the following code in the editor window:

app.toolbar = true;

  1. Click OK. The JavaScript Editor closes and returns you to the Document Actions dialog box where you can see the script you just added to the Document Will Close action, as shown in Figure 2.

Figure 2

  1. Click OK in the Document Actions and save the file.

The Document Action used here is Document Will Close. The JavaScript added to this action is invoked when the document closes, meaning in this case that the toolbars will be shown and return to the default view.

Opening files in full-screen mode

When you open a document in full-screen mode, all toolbars, navigation panels and menus are hidden. This view provides the maximum amount of screen area for viewing PDF pages. To navigate pages using Acrobat tools, each user has the option of adding a navigation toolbar when in full-screen mode to facilitate page navigation. Look at the Full Screen Preferences and note the checkbox for Show Navigation toolbar. When the box is checked, a toolbar appears where a user can easily move back and forth between pages by clicking the tools.

When it comes to user preferences, all users who view your files may have preferences set differently. Therefore, you can’t rely on something like the navigation tools for full-screen viewing to be visible on all computers where your files may be viewed. Creating navigation buttons alleviates the problem where there may be disparity in viewing preferences.

When a file is opened in full-screen mode, by default, a Hand cursor appears. Click the Hand tool and the view moves one page forward. To move backward, press the Shift key and press the Hand tool. If the Hand tool happens to be over a body of text, the cursor changes to an I-beam. Press Shift to move backward when the I-beam is in view and you’ll select text. In short, the default navigation using the hand tool in full-screen mode is clumsy and can be frustrating to novice users. A better solution is to create your own navigation buttons and disable the Hand tool so a user doesn’t inadvertently click and move forward in the document or select a body of text.

To disable the Hand tool in full-screen mode, create a Document Level JavaScript by following these steps:

  1. Open the JavaScript Functions dialog box. Select Advanced > Document Processing > Document JavaScripts.
  2. Add a JavaScript. Type a name for your script in the Script Name text box in the JavaScript Functions dialog box and click Add. The JavaScript Editor opens. Type the following code in the JavaScript Editor:

app.fs.clickAdvances = false;

  1. Click OK in the JavaScript Editor. You return to the JavaScript Functions dialog box shown in Figure 3. Click Close and you return to the Document pane.

Figure 3

The next step is to set the initial view to open in full-screen mode. Press Ctrl + D (Windows) or Command + D (Macintosh) and the Document Properties dialog box opens. Click the Initial View tab and check the box where you see Open in Full Screen mode, as shown in Figure 4.

Figure 4

Click OK in the Document Properties dialog box and save your file. The file will now open in full-screen mode with the Hand cursor hidden. Don’t worry about turning the Hand cursor back on. Another file you open in full-screen mode will return to defaults unless you add a similar JavaScript.

Read more Acrobat 8 tips from Ted Padova in the "Adobe Acrobat 8 PDF Bible," available from Amazon.




0 comments

Comments for this tutorial are now closed.

Comments for this tutorial are now closed.