10
Modifying the User Interface
Adding Navigation to PDF Documents
Adding Page Transitions
You may use Acrobat JavaScript to customize how page transitions occur for any pages
within a document. This is accomplished through the
doc
object’s
setPageTransitions
and
getPageTransitions
methods.
The
setPageTransitions
method accepts three parameters:
●
●
●
nStart
: the zero-based index of the beginning page
nEnd
: the zero-based index of the last page
aTrans
: a page transition array containing three values:
–
nDuration
: the time a page is displayed before automatically changing
–
cTransition
: the name of the transition to be applied
–
nTransDuration
: the duration in seconds of the transition effect
The name of the transition to be applied can be chosen from a comprehensive list made
available through the
fullscreen
object’s
transitions
property. To obtain the list,
type the following code into the
Console:
console.println("[" + app.fs.transitions + "]");
In addition, you may set up a default page transition through the
fullscreen
object’s
defaultTransition
property.
In the following example, page transitions are applied to pages 2-5. Each page displays for
10 seconds, and then an automatic transition occurs for one second:
this.setPageTransitions({
nStart: 2,
nEnd: 5,
aTrans: {
nDuration: 10,
cTransition: "WipeLeft",
nTransDuration: 1
}
});
// Set the viewing mode to full screen
app.fullScreen = true;
184
Acrobat JavaScript Scripting Guide