beautypg.com

Adding functionality to 3d designs with javascript, What javascripts can do, Add a javascript to a pdf – Adobe Acrobat 8 3D User Manual

Page 423

background image

416

ADOBE ACROBAT 3D VERSION 8

User Guide

Adding functionality to 3D designs with JavaScript

What JavaScripts can do

You can use JavaScript to do various things:

Create animations that simulate a product in action, demonstrate an assembly and disassembly, illustrate the
effects of one component upon another, or simulate camera movements around or through the model.

Let users take pieces out of a model, add pieces to it, or activate overlays, animations, or lighting changes.

Activate other files or modes. For example, you can display a 3D design as a wireframe, as nodes, in 2D, and so on.

You can set a JavaScript to start based on any action. For example, you might choose to have it automatically start
when a user opens the PDF, to start when a user clicks a button or link in the PDF, or even to start based on another
JavaScript file’s instructions.

To learn how to work with JavaScript, download JavaScript manuals from the

Acrobat JavaScript support

page

(English only) on the Adobe website. JavaScript for Acrobat 3D Annotations API Reference contains detailed infor­
mation about using JavaScripts to manipulate 3D objects in PDFs. Developing Acrobat Applications Using JavaScript
contains background information and tutorials, and JavaScript for Acrobat API Reference provides reference infor­
mation.

Add a JavaScript to a PDF

When you embed a JavaScript file as part of a 3D model and then save the PDF, the JavaScript file becomes part of
the PDF document.

1

Using the Select Object tool from the Advanced Editing toolbar, double-click the 3D design.

2

In the 3D Properties dialog box, select Edit Content.

3

In the Add 3D Content dialog box, click Browse For Default Script, and locate the JavaScript file.

By default, the embedded JavaScript runs when you activate the 3D model. You can also set page elements, such as
buttons or links, to trigger the JavaScript.

Instead of embedding the JavaScript file in the PDF, you can include it as a separate file that users load and run
manually. Typically, recipients must save the JavaScript file to their local hard drive. To activate this script, the user

right-clicks/Control-clicks the 3D design, chooses Run A JavaScript, and then browses to select the JavaScript file. This
approach runs the script but doesn’t save it with the image.

This manual is related to the following products: