aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/pdfbox/pdmodel/interactive/action
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/pdfbox/pdmodel/interactive/action')
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/action/PDActionFactory.java96
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/action/PDAdditionalActions.java106
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/action/PDAnnotationAdditionalActions.java380
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/action/PDDocumentCatalogAdditionalActions.java238
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/action/PDFormFieldAdditionalActions.java216
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/action/PDPageAdditionalActions.java150
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/action/package.html9
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDAction.java187
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionGoTo.java92
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionJavaScript.java102
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionLaunch.java244
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionRemoteGoTo.java187
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionURI.java183
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDWindowsLaunchParams.java180
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/action/type/package.html9
15 files changed, 2379 insertions, 0 deletions
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/action/PDActionFactory.java b/src/main/java/org/pdfbox/pdmodel/interactive/action/PDActionFactory.java
new file mode 100644
index 0000000..bf0c156
--- /dev/null
+++ b/src/main/java/org/pdfbox/pdmodel/interactive/action/PDActionFactory.java
@@ -0,0 +1,96 @@
+/**
+ * Copyright (c) 2004, www.pdfbox.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of pdfbox; nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://www.pdfbox.org
+ *
+ */
+package org.pdfbox.pdmodel.interactive.action;
+
+import org.pdfbox.cos.COSDictionary;
+
+import org.pdfbox.pdmodel.interactive.action.type.PDAction;
+import org.pdfbox.pdmodel.interactive.action.type.PDActionGoTo;
+import org.pdfbox.pdmodel.interactive.action.type.PDActionJavaScript;
+import org.pdfbox.pdmodel.interactive.action.type.PDActionLaunch;
+import org.pdfbox.pdmodel.interactive.action.type.PDActionRemoteGoTo;
+import org.pdfbox.pdmodel.interactive.action.type.PDActionURI;
+
+/**
+ * This class will take a dictionary and determine which type of action to create.
+ *
+ * @author Ben Litchfield (ben@csh.rit.edu)
+ * @version $Revision: 1.4 $
+ */
+public class PDActionFactory
+{
+ /**
+ * Utility Class.
+ */
+ private PDActionFactory()
+ {
+ //utility class
+ }
+
+ /**
+ * This will create the correct type of action based on the type specified
+ * in the dictionary.
+ *
+ * @param action An action dictionary.
+ *
+ * @return An action of the correct type.
+ */
+ public static PDAction createAction( COSDictionary action )
+ {
+ PDAction retval = null;
+ if( action != null )
+ {
+ String type = action.getNameAsString( "S" );
+ if( PDActionJavaScript.SUB_TYPE.equals( type ) )
+ {
+ retval = new PDActionJavaScript( action );
+ }
+ else if( PDActionGoTo.SUB_TYPE.equals( type ) )
+ {
+ retval = new PDActionGoTo( action );
+ }
+ else if( PDActionLaunch.SUB_TYPE.equals( type ) )
+ {
+ retval = new PDActionLaunch( action );
+ }
+ else if( PDActionRemoteGoTo.SUB_TYPE.equals( type ) )
+ {
+ retval = new PDActionRemoteGoTo( action );
+ }
+ else if( PDActionURI.SUB_TYPE.equals( type ) )
+ {
+ retval = new PDActionURI( action );
+ }
+ }
+ return retval;
+ }
+
+} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/action/PDAdditionalActions.java b/src/main/java/org/pdfbox/pdmodel/interactive/action/PDAdditionalActions.java
new file mode 100644
index 0000000..fc2f79b
--- /dev/null
+++ b/src/main/java/org/pdfbox/pdmodel/interactive/action/PDAdditionalActions.java
@@ -0,0 +1,106 @@
+/**
+ * Copyright (c) 2004, www.pdfbox.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of pdfbox; nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://www.pdfbox.org
+ *
+ */
+package org.pdfbox.pdmodel.interactive.action;
+
+import org.pdfbox.cos.COSBase;
+import org.pdfbox.cos.COSDictionary;
+
+import org.pdfbox.pdmodel.common.COSObjectable;
+import org.pdfbox.pdmodel.interactive.action.type.PDAction;
+
+/**
+ * This represents a dictionary of actions that occur due to events.
+ *
+ * @author Ben Litchfield (ben@csh.rit.edu)
+ * @version $Revision: 1.3 $
+ */
+public class PDAdditionalActions implements COSObjectable
+{
+ private COSDictionary actions;
+
+ /**
+ * Default constructor.
+ */
+ public PDAdditionalActions()
+ {
+ actions = new COSDictionary();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param a The action dictionary.
+ */
+ public PDAdditionalActions( COSDictionary a )
+ {
+ actions = a;
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSBase getCOSObject()
+ {
+ return actions;
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSDictionary getCOSDictionary()
+ {
+ return actions;
+ }
+
+ /**
+ * Get the F action.
+ *
+ * @return The F action.
+ */
+ public PDAction getF()
+ {
+ return PDActionFactory.createAction( (COSDictionary)actions.getDictionaryObject("F" ) );
+ }
+
+ /**
+ * Set the F action.
+ *
+ * @param action Get the F action.
+ */
+ public void setF( PDAction action )
+ {
+ actions.setItem( "F", action );
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/action/PDAnnotationAdditionalActions.java b/src/main/java/org/pdfbox/pdmodel/interactive/action/PDAnnotationAdditionalActions.java
new file mode 100644
index 0000000..9b9232e
--- /dev/null
+++ b/src/main/java/org/pdfbox/pdmodel/interactive/action/PDAnnotationAdditionalActions.java
@@ -0,0 +1,380 @@
+/**
+ * Copyright (c) 2004, www.pdfbox.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of pdfbox; nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://www.pdfbox.org
+ *
+ */
+package org.pdfbox.pdmodel.interactive.action;
+
+import org.pdfbox.cos.COSBase;
+import org.pdfbox.cos.COSDictionary;
+
+import org.pdfbox.pdmodel.common.COSObjectable;
+import org.pdfbox.pdmodel.interactive.action.type.PDAction;
+
+/**
+ * This class represents an annotation's dictionary of actions
+ * that occur due to events.
+ *
+ * @author Ben Litchfield (ben@csh.rit.edu)
+ * @author Panagiotis Toumasis (ptoumasis@mail.gr)
+ * @version $Revision: 1.1 $
+ */
+public class PDAnnotationAdditionalActions implements COSObjectable
+{
+ private COSDictionary actions;
+
+ /**
+ * Default constructor.
+ */
+ public PDAnnotationAdditionalActions()
+ {
+ actions = new COSDictionary();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param a The action dictionary.
+ */
+ public PDAnnotationAdditionalActions( COSDictionary a )
+ {
+ actions = a;
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSBase getCOSObject()
+ {
+ return actions;
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSDictionary getCOSDictionary()
+ {
+ return actions;
+ }
+
+ /**
+ * This will get an action to be performed when the cursor
+ * enters the annotation's active area.
+ *
+ * @return The E entry of annotation's additional actions dictionary.
+ */
+ public PDAction getE()
+ {
+ COSDictionary e = (COSDictionary)actions.getDictionaryObject( "E" );
+ PDAction retval = null;
+ if( e != null )
+ {
+ retval = PDActionFactory.createAction( e );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set an action to be performed when the cursor
+ * enters the annotation's active area.
+ *
+ * @param e The action to be performed.
+ */
+ public void setE( PDAction e )
+ {
+ actions.setItem( "E", e );
+ }
+
+ /**
+ * This will get an action to be performed when the cursor
+ * exits the annotation's active area.
+ *
+ * @return The X entry of annotation's additional actions dictionary.
+ */
+ public PDAction getX()
+ {
+ COSDictionary x = (COSDictionary)actions.getDictionaryObject( "X" );
+ PDAction retval = null;
+ if( x != null )
+ {
+ retval = PDActionFactory.createAction( x );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set an action to be performed when the cursor
+ * exits the annotation's active area.
+ *
+ * @param x The action to be performed.
+ */
+ public void setX( PDAction x )
+ {
+ actions.setItem( "X", x );
+ }
+
+ /**
+ * This will get an action to be performed when the mouse button
+ * is pressed inside the annotation's active area.
+ * The name D stands for "down".
+ *
+ * @return The d entry of annotation's additional actions dictionary.
+ */
+ public PDAction getD()
+ {
+ COSDictionary d = (COSDictionary)actions.getDictionaryObject( "D" );
+ PDAction retval = null;
+ if( d != null )
+ {
+ retval = PDActionFactory.createAction( d );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set an action to be performed when the mouse button
+ * is pressed inside the annotation's active area.
+ * The name D stands for "down".
+ *
+ * @param d The action to be performed.
+ */
+ public void setD( PDAction d )
+ {
+ actions.setItem( "D", d );
+ }
+
+ /**
+ * This will get an action to be performed when the mouse button
+ * is released inside the annotation's active area.
+ * The name U stands for "up".
+ *
+ * @return The U entry of annotation's additional actions dictionary.
+ */
+ public PDAction getU()
+ {
+ COSDictionary u = (COSDictionary)actions.getDictionaryObject( "U" );
+ PDAction retval = null;
+ if( u != null )
+ {
+ retval = PDActionFactory.createAction( u );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set an action to be performed when the mouse button
+ * is released inside the annotation's active area.
+ * The name U stands for "up".
+ *
+ * @param u The action to be performed.
+ */
+ public void setU( PDAction u )
+ {
+ actions.setItem( "U", u );
+ }
+
+ /**
+ * This will get an action to be performed when the annotation
+ * receives the input focus.
+ *
+ * @return The Fo entry of annotation's additional actions dictionary.
+ */
+ public PDAction getFo()
+ {
+ COSDictionary fo = (COSDictionary)actions.getDictionaryObject( "Fo" );
+ PDAction retval = null;
+ if( fo != null )
+ {
+ retval = PDActionFactory.createAction( fo );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set an action to be performed when the annotation
+ * receives the input focus.
+ *
+ * @param fo The action to be performed.
+ */
+ public void setFo( PDAction fo )
+ {
+ actions.setItem( "Fo", fo );
+ }
+
+ /**
+ * This will get an action to be performed when the annotation
+ * loses the input focus.
+ * The name Bl stands for "blurred".
+ *
+ * @return The Bl entry of annotation's additional actions dictionary.
+ */
+ public PDAction getBl()
+ {
+ COSDictionary bl = (COSDictionary)actions.getDictionaryObject( "Bl" );
+ PDAction retval = null;
+ if( bl != null )
+ {
+ retval = PDActionFactory.createAction( bl );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set an action to be performed when the annotation
+ * loses the input focus.
+ * The name Bl stands for "blurred".
+ *
+ * @param bl The action to be performed.
+ */
+ public void setBl( PDAction bl )
+ {
+ actions.setItem( "Bl", bl );
+ }
+
+ /**
+ * This will get an action to be performed when the page containing
+ * the annotation is opened. The action is executed after the O action
+ * in the page's additional actions dictionary and the OpenAction entry
+ * in the document catalog, if such actions are present.
+ *
+ * @return The PO entry of annotation's additional actions dictionary.
+ */
+ public PDAction getPO()
+ {
+ COSDictionary po = (COSDictionary)actions.getDictionaryObject( "PO" );
+ PDAction retval = null;
+ if( po != null )
+ {
+ retval = PDActionFactory.createAction( po );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set an action to be performed when the page containing
+ * the annotation is opened. The action is executed after the O action
+ * in the page's additional actions dictionary and the OpenAction entry
+ * in the document catalog, if such actions are present.
+ *
+ * @param po The action to be performed.
+ */
+ public void setPO( PDAction po )
+ {
+ actions.setItem( "PO", po );
+ }
+
+ /**
+ * This will get an action to be performed when the page containing
+ * the annotation is closed. The action is executed before the C action
+ * in the page's additional actions dictionary, if present.
+ *
+ * @return The PC entry of annotation's additional actions dictionary.
+ */
+ public PDAction getPC()
+ {
+ COSDictionary pc = (COSDictionary)actions.getDictionaryObject( "PC" );
+ PDAction retval = null;
+ if( pc != null )
+ {
+ retval = PDActionFactory.createAction( pc );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set an action to be performed when the page containing
+ * the annotation is closed. The action is executed before the C action
+ * in the page's additional actions dictionary, if present.
+ *
+ * @param pc The action to be performed.
+ */
+ public void setPC( PDAction pc )
+ {
+ actions.setItem( "PC", pc );
+ }
+
+ /**
+ * This will get an action to be performed when the page containing
+ * the annotation becomes visible in the viewer application's user interface.
+ *
+ * @return The PV entry of annotation's additional actions dictionary.
+ */
+ public PDAction getPV()
+ {
+ COSDictionary pv = (COSDictionary)actions.getDictionaryObject( "PV" );
+ PDAction retval = null;
+ if( pv != null )
+ {
+ retval = PDActionFactory.createAction( pv );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set an action to be performed when the page containing
+ * the annotation becomes visible in the viewer application's user interface.
+ *
+ * @param pv The action to be performed.
+ */
+ public void setPV( PDAction pv )
+ {
+ actions.setItem( "PV", pv );
+ }
+
+ /**
+ * This will get an action to be performed when the page containing the annotation
+ * is no longer visible in the viewer application's user interface.
+ *
+ * @return The PI entry of annotation's additional actions dictionary.
+ */
+ public PDAction getPI()
+ {
+ COSDictionary pi = (COSDictionary)actions.getDictionaryObject( "PI" );
+ PDAction retval = null;
+ if( pi != null )
+ {
+ retval = PDActionFactory.createAction( pi );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set an action to be performed when the page containing the annotation
+ * is no longer visible in the viewer application's user interface.
+ *
+ * @param pi The action to be performed.
+ */
+ public void setPI( PDAction pi )
+ {
+ actions.setItem( "PI", pi );
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/action/PDDocumentCatalogAdditionalActions.java b/src/main/java/org/pdfbox/pdmodel/interactive/action/PDDocumentCatalogAdditionalActions.java
new file mode 100644
index 0000000..6164de1
--- /dev/null
+++ b/src/main/java/org/pdfbox/pdmodel/interactive/action/PDDocumentCatalogAdditionalActions.java
@@ -0,0 +1,238 @@
+/**
+ * Copyright (c) 2004, www.pdfbox.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of pdfbox; nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://www.pdfbox.org
+ *
+ */
+package org.pdfbox.pdmodel.interactive.action;
+
+import org.pdfbox.cos.COSBase;
+import org.pdfbox.cos.COSDictionary;
+
+import org.pdfbox.pdmodel.common.COSObjectable;
+import org.pdfbox.pdmodel.interactive.action.type.PDAction;
+
+/**
+ * This class represents a document catalog's dictionary of actions
+ * that occur due to events.
+ *
+ * @author Ben Litchfield (ben@csh.rit.edu)
+ * @author Panagiotis Toumasis (ptoumasis@mail.gr)
+ * @version $Revision: 1.1 $
+ */
+public class PDDocumentCatalogAdditionalActions implements COSObjectable
+{
+ private COSDictionary actions;
+
+ /**
+ * Default constructor.
+ */
+ public PDDocumentCatalogAdditionalActions()
+ {
+ actions = new COSDictionary();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param a The action dictionary.
+ */
+ public PDDocumentCatalogAdditionalActions( COSDictionary a )
+ {
+ actions = a;
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSBase getCOSObject()
+ {
+ return actions;
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSDictionary getCOSDictionary()
+ {
+ return actions;
+ }
+
+ /**
+ * This will get a JavaScript action to be performed
+ * before closing a document.
+ * The name WC stands for "will close".
+ *
+ * @return The WC entry of document catalog's additional actions dictionary.
+ */
+ public PDAction getWC()
+ {
+ COSDictionary wc = (COSDictionary)actions.getDictionaryObject( "WC" );
+ PDAction retval = null;
+ if( wc != null )
+ {
+ retval = PDActionFactory.createAction( wc );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set a JavaScript action to be performed
+ * before closing a document.
+ * The name WC stands for "will close".
+ *
+ * @param wc The action to be performed.
+ */
+ public void setWC( PDAction wc )
+ {
+ actions.setItem( "WC", wc );
+ }
+
+ /**
+ * This will get a JavaScript action to be performed
+ * before saving a document.
+ * The name WS stands for "will save".
+ *
+ * @return The WS entry of document catalog's additional actions dictionary.
+ */
+ public PDAction getWS()
+ {
+ COSDictionary ws = (COSDictionary)actions.getDictionaryObject( "WS" );
+ PDAction retval = null;
+ if( ws != null )
+ {
+ retval = PDActionFactory.createAction( ws );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set a JavaScript action to be performed
+ * before saving a document.
+ * The name WS stands for "will save".
+ *
+ * @param ws The action to be performed.
+ */
+ public void setWS( PDAction ws )
+ {
+ actions.setItem( "WS", ws );
+ }
+
+ /**
+ * This will get a JavaScript action to be performed
+ * after saving a document.
+ * The name DS stands for "did save".
+ *
+ * @return The DS entry of document catalog's additional actions dictionary.
+ */
+ public PDAction getDS()
+ {
+ COSDictionary ds = (COSDictionary)actions.getDictionaryObject( "DS" );
+ PDAction retval = null;
+ if( ds != null )
+ {
+ retval = PDActionFactory.createAction( ds );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set a JavaScript action to be performed
+ * after saving a document.
+ * The name DS stands for "did save".
+ *
+ * @param ds The action to be performed.
+ */
+ public void setDS( PDAction ds )
+ {
+ actions.setItem( "DS", ds );
+ }
+
+ /**
+ * This will get a JavaScript action to be performed
+ * before printing a document.
+ * The name WP stands for "will print".
+ *
+ * @return The WP entry of document catalog's additional actions dictionary.
+ */
+ public PDAction getWP()
+ {
+ COSDictionary wp = (COSDictionary)actions.getDictionaryObject( "WP" );
+ PDAction retval = null;
+ if( wp != null )
+ {
+ retval = PDActionFactory.createAction( wp );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set a JavaScript action to be performed
+ * before printing a document.
+ * The name WP stands for "will print".
+ *
+ * @param wp The action to be performed.
+ */
+ public void setWP( PDAction wp )
+ {
+ actions.setItem( "WP", wp );
+ }
+
+ /**
+ * This will get a JavaScript action to be performed
+ * after printing a document.
+ * The name DP stands for "did print".
+ *
+ * @return The DP entry of document catalog's additional actions dictionary.
+ */
+ public PDAction getDP()
+ {
+ COSDictionary dp = (COSDictionary)actions.getDictionaryObject( "DP" );
+ PDAction retval = null;
+ if( dp != null )
+ {
+ retval = PDActionFactory.createAction( dp );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set a JavaScript action to be performed
+ * after printing a document.
+ * The name DP stands for "did print".
+ *
+ * @param dp The action to be performed.
+ */
+ public void setDP( PDAction dp )
+ {
+ actions.setItem( "DP", dp );
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/action/PDFormFieldAdditionalActions.java b/src/main/java/org/pdfbox/pdmodel/interactive/action/PDFormFieldAdditionalActions.java
new file mode 100644
index 0000000..2a594f3
--- /dev/null
+++ b/src/main/java/org/pdfbox/pdmodel/interactive/action/PDFormFieldAdditionalActions.java
@@ -0,0 +1,216 @@
+/**
+ * Copyright (c) 2004, www.pdfbox.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of pdfbox; nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://www.pdfbox.org
+ *
+ */
+package org.pdfbox.pdmodel.interactive.action;
+
+import org.pdfbox.cos.COSBase;
+import org.pdfbox.cos.COSDictionary;
+
+import org.pdfbox.pdmodel.common.COSObjectable;
+import org.pdfbox.pdmodel.interactive.action.type.PDAction;
+
+/**
+ * This class represents a form field's dictionary of actions
+ * that occur due to events.
+ *
+ * @author Ben Litchfield (ben@csh.rit.edu)
+ * @author Panagiotis Toumasis (ptoumasis@mail.gr)
+ * @version $Revision: 1.1 $
+ */
+public class PDFormFieldAdditionalActions implements COSObjectable
+{
+ private COSDictionary actions;
+
+ /**
+ * Default constructor.
+ */
+ public PDFormFieldAdditionalActions()
+ {
+ actions = new COSDictionary();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param a The action dictionary.
+ */
+ public PDFormFieldAdditionalActions( COSDictionary a )
+ {
+ actions = a;
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSBase getCOSObject()
+ {
+ return actions;
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSDictionary getCOSDictionary()
+ {
+ return actions;
+ }
+
+ /**
+ * This will get a JavaScript action to be performed when the user
+ * types a keystroke into a text field or combo box or modifies the
+ * selection in a scrollable list box. This allows the keystroke to
+ * be checked for validity and rejected or modified.
+ *
+ * @return The K entry of form field's additional actions dictionary.
+ */
+ public PDAction getK()
+ {
+ COSDictionary k = (COSDictionary)actions.getDictionaryObject( "K" );
+ PDAction retval = null;
+ if( k != null )
+ {
+ retval = PDActionFactory.createAction( k );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set a JavaScript action to be performed when the user
+ * types a keystroke into a text field or combo box or modifies the
+ * selection in a scrollable list box. This allows the keystroke to
+ * be checked for validity and rejected or modified.
+ *
+ * @param k The action to be performed.
+ */
+ public void setK( PDAction k )
+ {
+ actions.setItem( "K", k );
+ }
+
+ /**
+ * This will get a JavaScript action to be performed before
+ * the field is formatted to display its current value. This
+ * allows the field's value to be modified before formatting.
+ *
+ * @return The F entry of form field's additional actions dictionary.
+ */
+ public PDAction getF()
+ {
+ COSDictionary f = (COSDictionary)actions.getDictionaryObject( "F" );
+ PDAction retval = null;
+ if( f != null )
+ {
+ retval = PDActionFactory.createAction( f );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set a JavaScript action to be performed before
+ * the field is formatted to display its current value. This
+ * allows the field's value to be modified before formatting.
+ *
+ * @param f The action to be performed.
+ */
+ public void setF( PDAction f )
+ {
+ actions.setItem( "F", f );
+ }
+
+ /**
+ * This will get a JavaScript action to be performed
+ * when the field's value is changed. This allows the
+ * new value to be checked for validity.
+ * The name V stands for "validate".
+ *
+ * @return The V entry of form field's additional actions dictionary.
+ */
+ public PDAction getV()
+ {
+ COSDictionary v = (COSDictionary)actions.getDictionaryObject( "V" );
+ PDAction retval = null;
+ if( v != null )
+ {
+ retval = PDActionFactory.createAction( v );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set a JavaScript action to be performed
+ * when the field's value is changed. This allows the
+ * new value to be checked for validity.
+ * The name V stands for "validate".
+ *
+ * @param v The action to be performed.
+ */
+ public void setV( PDAction v )
+ {
+ actions.setItem( "V", v );
+ }
+
+ /**
+ * This will get a JavaScript action to be performed in order to recalculate
+ * the value of this field when that of another field changes. The order in which
+ * the document's fields are recalculated is defined by the CO entry in the
+ * interactive form dictionary.
+ * The name C stands for "calculate".
+ *
+ * @return The C entry of form field's additional actions dictionary.
+ */
+ public PDAction getC()
+ {
+ COSDictionary c = (COSDictionary)actions.getDictionaryObject( "C" );
+ PDAction retval = null;
+ if( c != null )
+ {
+ retval = PDActionFactory.createAction( c );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set a JavaScript action to be performed in order to recalculate
+ * the value of this field when that of another field changes. The order in which
+ * the document's fields are recalculated is defined by the CO entry in the
+ * interactive form dictionary.
+ * The name C stands for "calculate".
+ *
+ * @param c The action to be performed.
+ */
+ public void setC( PDAction c )
+ {
+ actions.setItem( "C", c );
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/action/PDPageAdditionalActions.java b/src/main/java/org/pdfbox/pdmodel/interactive/action/PDPageAdditionalActions.java
new file mode 100644
index 0000000..f15ffa7
--- /dev/null
+++ b/src/main/java/org/pdfbox/pdmodel/interactive/action/PDPageAdditionalActions.java
@@ -0,0 +1,150 @@
+/**
+ * Copyright (c) 2004, www.pdfbox.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of pdfbox; nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://www.pdfbox.org
+ *
+ */
+package org.pdfbox.pdmodel.interactive.action;
+
+import org.pdfbox.cos.COSBase;
+import org.pdfbox.cos.COSDictionary;
+
+import org.pdfbox.pdmodel.common.COSObjectable;
+import org.pdfbox.pdmodel.interactive.action.type.PDAction;
+
+/**
+ * This class represents a page object's dictionary of actions
+ * that occur due to events.
+ *
+ * @author Ben Litchfield (ben@csh.rit.edu)
+ * @author Panagiotis Toumasis (ptoumasis@mail.gr)
+ * @version $Revision: 1.1 $
+ */
+public class PDPageAdditionalActions implements COSObjectable
+{
+ private COSDictionary actions;
+
+ /**
+ * Default constructor.
+ */
+ public PDPageAdditionalActions()
+ {
+ actions = new COSDictionary();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param a The action dictionary.
+ */
+ public PDPageAdditionalActions( COSDictionary a )
+ {
+ actions = a;
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSBase getCOSObject()
+ {
+ return actions;
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSDictionary getCOSDictionary()
+ {
+ return actions;
+ }
+
+ /**
+ * This will get an action to be performed when the page
+ * is opened. This action is independent of any that may be
+ * defined by the OpenAction entry in the document catalog,
+ * and is executed after such an action.
+ *
+ * @return The O entry of page object's additional actions dictionary.
+ */
+ public PDAction getO()
+ {
+ COSDictionary o = (COSDictionary)actions.getDictionaryObject( "O" );
+ PDAction retval = null;
+ if( o != null )
+ {
+ retval = PDActionFactory.createAction( o );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set an action to be performed when the page
+ * is opened. This action is independent of any that may be
+ * defined by the OpenAction entry in the document catalog,
+ * and is executed after such an action.
+ *
+ * @param o The action to be performed.
+ */
+ public void setO( PDAction o )
+ {
+ actions.setItem( "O", o );
+ }
+
+ /**
+ * This will get an action to be performed when the page
+ * is closed. This action applies to the page being closed,
+ * and is executed before any other page opened.
+ *
+ * @return The C entry of page object's additional actions dictionary.
+ */
+ public PDAction getC()
+ {
+ COSDictionary c = (COSDictionary)actions.getDictionaryObject( "C" );
+ PDAction retval = null;
+ if( c != null )
+ {
+ retval = PDActionFactory.createAction( c );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set an action to be performed when the page
+ * is closed. This action applies to the page being closed,
+ * and is executed before any other page opened.
+ *
+ * @param c The action to be performed.
+ */
+ public void setC( PDAction c )
+ {
+ actions.setItem( "C", c );
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/action/package.html b/src/main/java/org/pdfbox/pdmodel/interactive/action/package.html
new file mode 100644
index 0000000..63cbfc0
--- /dev/null
+++ b/src/main/java/org/pdfbox/pdmodel/interactive/action/package.html
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+
+</head>
+<body>
+This package represents actions that can be performed in a PDF document.
+</body>
+</html>
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDAction.java b/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDAction.java
new file mode 100644
index 0000000..21d40fc
--- /dev/null
+++ b/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDAction.java
@@ -0,0 +1,187 @@
+/**
+ * Copyright (c) 2004, www.pdfbox.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of pdfbox; nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://www.pdfbox.org
+ *
+ */
+package org.pdfbox.pdmodel.interactive.action.type;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.pdfbox.cos.COSArray;
+import org.pdfbox.cos.COSBase;
+import org.pdfbox.cos.COSDictionary;
+
+import org.pdfbox.pdmodel.common.COSObjectable;
+import org.pdfbox.pdmodel.common.COSArrayList;
+import org.pdfbox.pdmodel.interactive.action.PDActionFactory;
+
+/**
+ * This represents an action that can be executed in a PDF document.
+ *
+ * @author Ben Litchfield (ben@csh.rit.edu)
+ * @author Panagiotis Toumasis (ptoumasis@mail.gr)
+ * @version $Revision: 1.1 $
+ */
+public abstract class PDAction implements COSObjectable
+{
+ /**
+ * The type of PDF object.
+ */
+ public static final String TYPE = "Action";
+
+ /**
+ * The action dictionary.
+ */
+ protected COSDictionary action;
+
+ /**
+ * Default constructor.
+ */
+ public PDAction()
+ {
+ action = new COSDictionary();
+ setType( TYPE );
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param a The action dictionary.
+ */
+ public PDAction( COSDictionary a )
+ {
+ action = a;
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSBase getCOSObject()
+ {
+ return action;
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSDictionary getCOSDictionary()
+ {
+ return action;
+ }
+
+ /**
+ * This will get the type of PDF object that the actions dictionary describes.
+ * If present must be Action for an action dictionary.
+ *
+ * @return The Type of PDF object.
+ */
+ public String getType()
+ {
+ return action.getNameAsString( "Type" );
+ }
+
+ /**
+ * This will set the type of PDF object that the actions dictionary describes.
+ * If present must be Action for an action dictionary.
+ *
+ * @param type The new Type for the PDF object.
+ */
+ public void setType( String type )
+ {
+ action.setName( "Type", type );
+ }
+
+ /**
+ * This will get the type of action that the actions dictionary describes.
+ * If present, must be Action for an action dictionary.
+ *
+ * @return The S entry of actions dictionary.
+ */
+ public String getSubType()
+ {
+ return action.getNameAsString( "S" );
+ }
+
+ /**
+ * This will set the type of action that the actions dictionary describes.
+ * If present, must be Action for an action dictionary.
+ *
+ * @param s The new type of action.
+ */
+ public void setSubType( String s )
+ {
+ action.setName( "S", s );
+ }
+
+ /**
+ * This will get the next action, or sequence of actions, to be performed after this one.
+ * The value is either a single action dictionary or an array of action dictionaries
+ * to be performed in order.
+ *
+ * @return The Next action or sequence of actions.
+ */
+ public List getNext()
+ {
+ List retval = null;
+ COSBase next = action.getDictionaryObject( "Next" );
+ if( next instanceof COSDictionary )
+ {
+ PDAction pdAction = PDActionFactory.createAction( (COSDictionary) next );
+ retval = new COSArrayList(pdAction, next, action, "Next" );
+ }
+ else if( next instanceof COSArray )
+ {
+ COSArray array = (COSArray)next;
+ List actions = new ArrayList();
+ for( int i=0; i<array.size(); i++ )
+ {
+ actions.add( PDActionFactory.createAction( (COSDictionary) array.getObject( i )));
+ }
+ retval = new COSArrayList( actions, array );
+ }
+
+ return retval;
+ }
+
+ /**
+ * This will set the next action, or sequence of actions, to be performed after this one.
+ * The value is either a single action dictionary or an array of action dictionaries
+ * to be performed in order.
+ *
+ * @param next The Next action or sequence of actions.
+ */
+ public void setNext( List next )
+ {
+ action.setItem( "Next", COSArrayList.converterToCOSArray( next ) );
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionGoTo.java b/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionGoTo.java
new file mode 100644
index 0000000..abf0ab5
--- /dev/null
+++ b/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionGoTo.java
@@ -0,0 +1,92 @@
+/**
+ * Copyright (c) 2004, www.pdfbox.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of pdfbox; nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://www.pdfbox.org
+ *
+ */
+package org.pdfbox.pdmodel.interactive.action.type;
+
+import java.io.IOException;
+
+import org.pdfbox.cos.COSDictionary;
+import org.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination;
+
+/**
+ * This represents a go-to action that can be executed in a PDF document.
+ *
+ * @author Ben Litchfield (ben@csh.rit.edu)
+ * @author Panagiotis Toumasis (ptoumasis@mail.gr)
+ * @version $Revision: 1.1 $
+ */
+public class PDActionGoTo extends PDAction
+{
+ /**
+ * This type of action this object represents.
+ */
+ public static final String SUB_TYPE = "GoTo";
+
+ /**
+ * Default constructor.
+ */
+ public PDActionGoTo()
+ {
+ super();
+ setSubType( SUB_TYPE );
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param a The action dictionary.
+ */
+ public PDActionGoTo( COSDictionary a )
+ {
+ super( a );
+ }
+
+ /**
+ * This will get the destination to jump to.
+ *
+ * @return The D entry of the specific go-to action dictionary.
+ *
+ * @throws IOException If there is an error creating the destination.
+ */
+ public PDDestination getDestination() throws IOException
+ {
+ return PDDestination.create( getCOSDictionary().getDictionaryObject( "D" ) );
+ }
+
+ /**
+ * This will set the destination to jump to.
+ *
+ * @param d The destination.
+ */
+ public void setDestination( PDDestination d )
+ {
+ getCOSDictionary().setItem( "D", d );
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionJavaScript.java b/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionJavaScript.java
new file mode 100644
index 0000000..3148dd3
--- /dev/null
+++ b/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionJavaScript.java
@@ -0,0 +1,102 @@
+/**
+ * Copyright (c) 2004, www.pdfbox.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of pdfbox; nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://www.pdfbox.org
+ *
+ */
+package org.pdfbox.pdmodel.interactive.action.type;
+
+import org.pdfbox.cos.COSDictionary;
+import org.pdfbox.pdmodel.common.PDTextStream;
+
+/**
+ * This represents a JavaScript action.
+ *
+ * @author Michael Schwarzenberger (mi2kee@gmail.com)
+ * @version $Revision: 1.1 $
+ */
+public class PDActionJavaScript extends PDAction
+{
+ /**
+ * This type of action this object represents.
+ */
+ public static final String SUB_TYPE = "JavaScript";
+
+ /**
+ * Constructor #1.
+ */
+ public PDActionJavaScript()
+ {
+ super();
+ setSubType( SUB_TYPE );
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param js Some javascript code.
+ */
+ public PDActionJavaScript( String js )
+ {
+ this();
+ setAction( js );
+ }
+
+ /**
+ * Constructor #2.
+ *
+ * @param a The action dictionary.
+ */
+ public PDActionJavaScript(COSDictionary a)
+ {
+ super(a);
+ }
+
+ /**
+ * @param sAction The JavaScript.
+ */
+ public void setAction(PDTextStream sAction)
+ {
+ action.setItem("JS", sAction);
+ }
+
+ /**
+ * @param sAction The JavaScript.
+ */
+ public void setAction(String sAction)
+ {
+ action.setString("JS", sAction);
+ }
+
+ /**
+ * @return The Javascript Code.
+ */
+ public PDTextStream getAction()
+ {
+ return PDTextStream.createTextStream( action.getDictionaryObject("JS") );
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionLaunch.java b/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionLaunch.java
new file mode 100644
index 0000000..3c2ef74
--- /dev/null
+++ b/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionLaunch.java
@@ -0,0 +1,244 @@
+/**
+ * Copyright (c) 2004-2005, www.pdfbox.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of pdfbox; nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://www.pdfbox.org
+ *
+ */
+package org.pdfbox.pdmodel.interactive.action.type;
+
+import org.pdfbox.cos.COSDictionary;
+
+import org.pdfbox.pdmodel.common.filespecification.PDFileSpecification;
+
+/**
+ * This represents a launch action that can be executed in a PDF document.
+ *
+ * @author Ben Litchfield (ben@benlitchfield.com)
+ * @author Panagiotis Toumasis (ptoumasis@mail.gr)
+ * @version $Revision: 1.3 $
+ */
+public class PDActionLaunch extends PDAction
+{
+
+ /**
+ * This type of action this object represents.
+ */
+ public static final String SUB_TYPE = "Launch";
+
+ /**
+ * Default constructor.
+ */
+ public PDActionLaunch()
+ {
+ super();
+ setSubType( SUB_TYPE );
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param a The action dictionary.
+ */
+ public PDActionLaunch( COSDictionary a )
+ {
+ super( a );
+ }
+
+ /**
+ * This will get the application to be launched or the document
+ * to be opened or printed. It is required if none of the entries
+ * Win, Mac or Unix is present. If this entry is absent and the
+ * viewer application does not understand any of the alternative
+ * entries it should do nothing.
+ *
+ * @return The F entry of the specific launch action dictionary.
+ */
+ public PDFileSpecification getFile()
+ {
+ return PDFileSpecification.createFS( getCOSDictionary().getDictionaryObject( "F" ) );
+ }
+
+ /**
+ * This will set the application to be launched or the document
+ * to be opened or printed. It is required if none of the entries
+ * Win, Mac or Unix is present. If this entry is absent and the
+ * viewer application does not understand any of the alternative
+ * entries it should do nothing.
+ *
+ * @param fs The file specification.
+ */
+ public void setFile( PDFileSpecification fs )
+ {
+ getCOSDictionary().setItem( "F", fs );
+ }
+
+ /**
+ * This will get a dictionary containing Windows-specific launch parameters.
+ *
+ * @return The Win entry of of the specific launch action dictionary.
+ */
+ public PDWindowsLaunchParams getWinLaunchParams()
+ {
+ COSDictionary win = (COSDictionary)action.getDictionaryObject( "Win" );
+ PDWindowsLaunchParams retval = null;
+ if( win != null )
+ {
+ retval = new PDWindowsLaunchParams( win );
+ }
+ return retval;
+ }
+
+ /**
+ * This will set a dictionary containing Windows-specific launch parameters.
+ *
+ * @param win The action to be performed.
+ */
+ public void setWinLaunchParams( PDWindowsLaunchParams win )
+ {
+ action.setItem( "Win", win );
+ }
+
+ /**
+ * This will get the file name to be launched or the document to be opened
+ * or printed, in standard Windows pathname format. If the name string includes
+ * a backslash character (\), the backslash must itself be preceded by a backslash.
+ * This value must be a single string; it is not a file specification.
+ *
+ * @return The F entry of the specific Windows launch parameter dictionary.
+ */
+ public String getF()
+ {
+ return action.getString( "F" );
+ }
+
+ /**
+ * This will set the file name to be launched or the document to be opened
+ * or printed, in standard Windows pathname format. If the name string includes
+ * a backslash character (\), the backslash must itself be preceded by a backslash.
+ * This value must be a single string; it is not a file specification.
+ *
+ * @param f The file name to be launched.
+ */
+ public void setF( String f )
+ {
+ action.setString( "F", f );
+ }
+
+ /**
+ * This will get the string specifying the default directory in standard DOS syntax.
+ *
+ * @return The D entry of the specific Windows launch parameter dictionary.
+ */
+ public String getD()
+ {
+ return action.getString( "D" );
+ }
+
+ /**
+ * This will set the string specifying the default directory in standard DOS syntax.
+ *
+ * @param d The default directory.
+ */
+ public void setD( String d )
+ {
+ action.setString( "D", d );
+ }
+
+ /**
+ * This will get the string specifying the operation to perform:
+ * open to open a document
+ * print to print a document
+ * If the F entry designates an application instead of a document, this entry
+ * is ignored and the application is launched. Default value: open.
+ *
+ * @return The O entry of the specific Windows launch parameter dictionary.
+ */
+ public String getO()
+ {
+ return action.getString( "O" );
+ }
+
+ /**
+ * This will set the string specifying the operation to perform:
+ * open to open a document
+ * print to print a document
+ * If the F entry designates an application instead of a document, this entry
+ * is ignored and the application is launched. Default value: open.
+ *
+ * @param o The operation to perform.
+ */
+ public void setO( String o )
+ {
+ action.setString( "O", o );
+ }
+
+ /**
+ * This will get a parameter string to be passed to the application designated by the F entry.
+ * This entry should be omitted if F designates a document.
+ *
+ * @return The P entry of the specific Windows launch parameter dictionary.
+ */
+ public String getP()
+ {
+ return action.getString( "P" );
+ }
+
+ /**
+ * This will set a parameter string to be passed to the application designated by the F entry.
+ * This entry should be omitted if F designates a document.
+ *
+ * @param p The parameter string.
+ */
+ public void setP( String p )
+ {
+ action.setString( "P", p );
+ }
+
+ /**
+ * This will specify whether to open the destination document in a new window.
+ * If this flag is false, the destination document will replace the current
+ * document in the same window. If this entry is absent, the viewer application
+ * should behave in accordance with the current user preference. This entry is
+ * ignored if the file designated by the F entry is not a PDF document.
+ *
+ * @return A flag specifying whether to open the destination document in a new window.
+ */
+ public boolean shouldOpenInNewWindow()
+ {
+ return action.getBoolean( "NewWindow", true );
+ }
+
+ /**
+ * This will specify the destination document to open in a new window.
+ *
+ * @param value The flag value.
+ */
+ public void setOpenInNewWindow( boolean value )
+ {
+ action.setBoolean( "NewWindow", value );
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionRemoteGoTo.java b/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionRemoteGoTo.java
new file mode 100644
index 0000000..73dbc6c
--- /dev/null
+++ b/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionRemoteGoTo.java
@@ -0,0 +1,187 @@
+/**
+ * Copyright (c) 2004, www.pdfbox.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of pdfbox; nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://www.pdfbox.org
+ *
+ */
+package org.pdfbox.pdmodel.interactive.action.type;
+
+import org.pdfbox.cos.COSBase;
+import org.pdfbox.cos.COSDictionary;
+
+import org.pdfbox.pdmodel.common.filespecification.PDFileSpecification;
+
+/**
+ * This represents a remote go-to action that can be executed in a PDF document.
+ *
+ * @author Ben Litchfield (ben@csh.rit.edu)
+ * @author Panagiotis Toumasis (ptoumasis@mail.gr)
+ * @version $Revision: 1.2 $
+ */
+public class PDActionRemoteGoTo extends PDAction
+{
+ /**
+ * This type of action this object represents.
+ */
+ public static final String SUB_TYPE = "GoToR";
+
+ /**
+ * Default constructor.
+ */
+ public PDActionRemoteGoTo()
+ {
+ action = new COSDictionary();
+ setSubType( SUB_TYPE );
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param a The action dictionary.
+ */
+ public PDActionRemoteGoTo( COSDictionary a )
+ {
+ super( a );
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSBase getCOSObject()
+ {
+ return action;
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSDictionary getCOSDictionary()
+ {
+ return action;
+ }
+
+ /**
+ * This will get the type of action that the actions dictionary describes.
+ * It must be GoToR for a remote go-to action.
+ *
+ * @return The S entry of the specific remote go-to action dictionary.
+ */
+ public String getS()
+ {
+ return action.getNameAsString( "S" );
+ }
+
+ /**
+ * This will set the type of action that the actions dictionary describes.
+ * It must be GoToR for a remote go-to action.
+ *
+ * @param s The remote go-to action.
+ */
+ public void setS( String s )
+ {
+ action.setName( "S", s );
+ }
+
+ /**
+ * This will get the file in which the destination is located.
+ *
+ * @return The F entry of the specific remote go-to action dictionary.
+ */
+ public PDFileSpecification getFile()
+ {
+ return PDFileSpecification.createFS( action.getDictionaryObject( "F" ) );
+ }
+
+ /**
+ * This will set the file in which the destination is located.
+ *
+ * @param fs The file specification.
+ */
+ public void setFile( PDFileSpecification fs )
+ {
+ action.setItem( "F", fs );
+ }
+
+ /**
+ * This will get the destination to jump to.
+ * If the value is an array defining an explicit destination,
+ * its first element must be a page number within the remote
+ * document rather than an indirect reference to a page object
+ * in the current document. The first page is numbered 0.
+ *
+ * @return The D entry of the specific remote go-to action dictionary.
+ */
+
+ // Array or String.
+ public COSBase getD()
+ {
+ return action.getDictionaryObject( "D" );
+ }
+
+ /**
+ * This will set the destination to jump to.
+ * If the value is an array defining an explicit destination,
+ * its first element must be a page number within the remote
+ * document rather than an indirect reference to a page object
+ * in the current document. The first page is numbered 0.
+ *
+ * @param d The destination.
+ */
+
+ // In case the value is an array.
+ public void setD( COSBase d )
+ {
+ action.setItem( "D", d );
+ }
+
+ /**
+ * This will specify whether to open the destination document in a new window.
+ * If this flag is false, the destination document will replace the current
+ * document in the same window. If this entry is absent, the viewer application
+ * should behave in accordance with the current user preference.
+ *
+ * @return A flag specifying whether to open the destination document in a new window.
+ */
+ public boolean shouldOpenInNewWindow()
+ {
+ return action.getBoolean( "NewWindow", true );
+ }
+
+ /**
+ * This will specify the destination document to open in a new window.
+ *
+ * @param value The flag value.
+ */
+ public void setOpenInNewWindow( boolean value )
+ {
+ action.setBoolean( "NewWindow", value );
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionURI.java b/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionURI.java
new file mode 100644
index 0000000..b98495d
--- /dev/null
+++ b/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDActionURI.java
@@ -0,0 +1,183 @@
+/**
+ * Copyright (c) 2004, www.pdfbox.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of pdfbox; nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://www.pdfbox.org
+ *
+ */
+package org.pdfbox.pdmodel.interactive.action.type;
+
+import org.pdfbox.cos.COSBase;
+import org.pdfbox.cos.COSDictionary;
+
+/**
+ * This represents a URI action that can be executed in a PDF document.
+ *
+ * @author Ben Litchfield (ben@csh.rit.edu)
+ * @author Panagiotis Toumasis (ptoumasis@mail.gr)
+ * @version $Revision: 1.2 $
+ */
+public class PDActionURI extends PDAction
+{
+ /**
+ * This type of action this object represents.
+ */
+ public static final String SUB_TYPE = "URI";
+
+ /**
+ * Default constructor.
+ */
+ public PDActionURI()
+ {
+ action = new COSDictionary();
+ setSubType( SUB_TYPE );
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param a The action dictionary.
+ */
+ public PDActionURI( COSDictionary a )
+ {
+ super( a );
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSBase getCOSObject()
+ {
+ return action;
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSDictionary getCOSDictionary()
+ {
+ return action;
+ }
+
+ /**
+ * This will get the type of action that the actions dictionary describes.
+ * It must be URI for a URI action.
+ *
+ * @return The S entry of the specific URI action dictionary.
+ */
+ public String getS()
+ {
+ return action.getNameAsString( "S" );
+ }
+
+ /**
+ * This will set the type of action that the actions dictionary describes.
+ * It must be URI for a URI action.
+ *
+ * @param s The URI action.
+ */
+ public void setS( String s )
+ {
+ action.setName( "S", s );
+ }
+
+ /**
+ * This will get the uniform resource identifier to resolve, encoded in 7-bit ASCII.
+ *
+ * @return The URI entry of the specific URI action dictionary.
+ */
+ public String getURI()
+ {
+ return action.getString( "URI" );
+ }
+
+ /**
+ * This will set the uniform resource identifier to resolve, encoded in 7-bit ASCII.
+ *
+ * @param uri The uniform resource identifier.
+ */
+ public void setURI( String uri )
+ {
+ action.setString( "URI", uri );
+ }
+
+ /**
+ * This will specify whether to track the mouse position when the URI is resolved.
+ * Default value: false.
+ * This entry applies only to actions triggered by the user's clicking an annotation;
+ * it is ignored for actions associated with outline items or with a document's OpenAction entry.
+ *
+ * @return A flag specifying whether to track the mouse position when the URI is resolved.
+ */
+ public boolean shouldTrackMousePosition()
+ {
+ return action.getBoolean( "MousePosition", true );
+ }
+
+ /**
+ * This will specify whether to track the mouse position when the URI is resolved.
+ *
+ * @param value The flag value.
+ */
+ public void setTrackMousePosition( boolean value )
+ {
+ action.setBoolean( "MousePosition", value );
+ }
+
+ /**
+ * This will get the base URI to be used in resolving relative URI references.
+ * URI actions within the document may specify URIs in partial form, to be interpreted
+ * relative to this base address. If no base URI is specified, such partial URIs
+ * will be interpreted relative to the location of the document itself.
+ * The use of this entry is parallel to that of the body element &lt;BASE&gt;, as described
+ * in the HTML 4.01 Specification.
+ *
+ * @return The URI entry of the specific URI dictionary.
+ */
+ public String getBase()
+ {
+ return action.getString( "Base" );
+ }
+
+ /**
+ * This will set the base URI to be used in resolving relative URI references.
+ * URI actions within the document may specify URIs in partial form, to be interpreted
+ * relative to this base address. If no base URI is specified, such partial URIs
+ * will be interpreted relative to the location of the document itself.
+ * The use of this entry is parallel to that of the body element &lt;BASE&gt;, as described
+ * in the HTML 4.01 Specification.
+ *
+ * @param base The the base URI to be used.
+ */
+ public void setBase( String base )
+ {
+ action.setString( "Base", base );
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDWindowsLaunchParams.java b/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDWindowsLaunchParams.java
new file mode 100644
index 0000000..7af4ff2
--- /dev/null
+++ b/src/main/java/org/pdfbox/pdmodel/interactive/action/type/PDWindowsLaunchParams.java
@@ -0,0 +1,180 @@
+/**
+ * Copyright (c) 2004, www.pdfbox.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of pdfbox; nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://www.pdfbox.org
+ *
+ */
+package org.pdfbox.pdmodel.interactive.action.type;
+
+import org.pdfbox.cos.COSBase;
+import org.pdfbox.cos.COSDictionary;
+
+import org.pdfbox.pdmodel.common.COSObjectable;
+
+/**
+ * Launch paramaters for the windows OS.
+ *
+ * @author Ben Litchfield (ben@csh.rit.edu)
+ * @version $Revision: 1.1 $
+ */
+public class PDWindowsLaunchParams implements COSObjectable
+{
+ /**
+ * The open operation for the launch.
+ */
+ public static final String OPERATION_OPEN = "open";
+ /**
+ * The print operation for the lanuch.
+ */
+ public static final String OPERATION_PRINT = "print";
+
+ /**
+ * The params dictionary.
+ */
+ protected COSDictionary params;
+
+ /**
+ * Default constructor.
+ */
+ public PDWindowsLaunchParams()
+ {
+ params = new COSDictionary();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param p The params dictionary.
+ */
+ public PDWindowsLaunchParams( COSDictionary p )
+ {
+ params = p;
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSBase getCOSObject()
+ {
+ return params;
+ }
+
+ /**
+ * Convert this standard java object to a COS object.
+ *
+ * @return The cos object that matches this Java object.
+ */
+ public COSDictionary getCOSDictionary()
+ {
+ return params;
+ }
+
+ /**
+ * The file to launch.
+ *
+ * @return The executable/document to launch.
+ */
+ public String getFilename()
+ {
+ return params.getString( "F" );
+ }
+
+ /**
+ * Set the file to launch.
+ *
+ * @param file The executable/document to launch.
+ */
+ public void setFilename( String file )
+ {
+ params.setString( "F", file );
+ }
+
+ /**
+ * The dir to launch from.
+ *
+ * @return The dir of the executable/document to launch.
+ */
+ public String getDirectory()
+ {
+ return params.getString( "D" );
+ }
+
+ /**
+ * Set the dir to launch from.
+ *
+ * @param dir The dir of the executable/document to launch.
+ */
+ public void setDirectory( String dir )
+ {
+ params.setString( "D", dir );
+ }
+
+ /**
+ * Get the operation to perform on the file. This method will not return null,
+ * OPERATION_OPEN is the default.
+ *
+ * @return The operation to perform for the file.
+ * @see PDWindowsLaunchParams#OPERATION_OPEN
+ * @see PDWindowsLaunchParams#OPERATION_PRINT
+ */
+ public String getOperation()
+ {
+ return params.getString( "O", OPERATION_OPEN );
+ }
+
+ /**
+ * Set the operation to perform..
+ *
+ * @param op The operation to perform on the file.
+ */
+ public void setOperation( String op )
+ {
+ params.setString( "D", op );
+ }
+
+ /**
+ * A parameter to pass the executable.
+ *
+ * @return The parameter to pass the executable.
+ */
+ public String getExecuteParam()
+ {
+ return params.getString( "P" );
+ }
+
+ /**
+ * Set the parameter to pass the executable.
+ *
+ * @param param The parameter for the executable.
+ */
+ public void setExecuteParam( String param )
+ {
+ params.setString( "P", param );
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/action/type/package.html b/src/main/java/org/pdfbox/pdmodel/interactive/action/type/package.html
new file mode 100644
index 0000000..f0db5c3
--- /dev/null
+++ b/src/main/java/org/pdfbox/pdmodel/interactive/action/type/package.html
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+
+</head>
+<body>
+This package contains all of the available PDF action types.
+</body>
+</html>