}
// 2.2. Remote go-to.
{
Page page = document.getPages().get(1); // Page 2 (zero-based index).
PageActions pageActions = page.getActions();
if(pageActions == null)
{
page.setActions(pageActions = new PageActions(document));
page.update();
}
try
{
/*
NOTE: This statement instructs the PDF viewer to navigate to the given URI on page 2 opening.
*/
pageActions.setOnOpen(
new GoToURI(
document,
new URI("http://www.sourceforge.net/projects/clown")
)
);
pageActions.update();
}
catch(Exception exception)
{throw new RuntimeException(exception);}
}