InteractiveActionCollection Class
A collection of actions that run after an interactive action.
Declaration
public class InteractiveActionCollection extends TrackedObjectCollection<InteractiveAction>
Remarks
Call the InteractiveAction.setNext(value) method to specify actions that run after the current action.
The collection implements the java.util.List interface and does not accept null items. If you add or insert a null item or replace an item with null, the API throws an ArgumentNullException. If you pass an index outside the collection bounds, the API throws an ArgumentOutOfRangeException.
Refer to the following help topic for additional information: Create and Manage PDF Bookmarks.
Example: Run Multiple Actions from a Bookmark
The following code snippet creates a bookmark that navigates to the last page and then opens a web page:
import java.io.*;
import java.nio.file.*;
import java.util.List;
import com.devexpress.docs.pdf.*;
public class Main {
public static void main(String[] args) throws Exception {
try (PdfDocument document = new PdfDocument()) {
document.getPages().add(595, 842);
Page lastPage = document.getPages().add(595, 842);
UriAction uriAction = new UriAction();
uriAction.setUri("https://www.devexpress.com");
GoToAction goToAction = new GoToAction();
goToAction.setPage(lastPage);
goToAction.setDestination(new FitDestination());
goToAction.setNext(new InteractiveActionCollection(List.of(uriAction)));
Bookmark bookmark = new Bookmark("Contacts");
bookmark.setActionTarget(new ActionTarget(goToAction));
document.getBookmarks().add(bookmark);
Files.createDirectories(Path.of("output"));
try (OutputStream stream = Files.newOutputStream(Path.of("output", "Document.pdf"))) {
document.save(stream);
}
}
}
}
Inherited Members
Inheritance
Constructors
InteractiveActionCollection() Constructor
Initializes a new instance of the InteractiveActionCollection class.
Declaration
public InteractiveActionCollection()
InteractiveActionCollection(Iterable<InteractiveAction> actions) Constructor
Initializes a new instance of the InteractiveActionCollection class with the specified actions.
Declaration
public InteractiveActionCollection(Iterable<InteractiveAction> actions)
Parameters
| Name | Type | Description |
|---|---|---|
| actions | java.lang.Iterable<InteractiveAction> | Actions to add to the collection. |
Exceptions
| Type | Description |
|---|---|
| ArgumentNullException | Thrown if the |
Methods
getSource() Method
Returns the internal collection that stores collection items.
Declaration
public InteractiveActionCollection getSource()
Returns
| Type | Description |
|---|---|
| com.devexpress.docs.pdf.internal.InteractiveActionCollection | The internal collection. |
Remarks
The getSource() method supports the internal infrastructure of the PDF Document API. Do not call the getSource() method in your code.