aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/pdfbox/pdmodel/interactive/annotation
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/pdfbox/pdmodel/interactive/annotation')
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java503
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAnnotationRubberStamp.java153
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAnnotationUnknown.java54
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAnnotationWidget.java65
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAppearanceDictionary.java245
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAppearanceStream.java146
-rw-r--r--src/main/java/org/pdfbox/pdmodel/interactive/annotation/package.html9
7 files changed, 0 insertions, 1175 deletions
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java b/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java
deleted file mode 100644
index 4d245c0..0000000
--- a/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/**
- * Copyright (c) 2003-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.annotation;
-
-import java.io.IOException;
-
-import org.pdfbox.cos.COSArray;
-import org.pdfbox.cos.COSDictionary;
-import org.pdfbox.cos.COSName;
-
-import org.pdfbox.pdmodel.common.COSObjectable;
-import org.pdfbox.pdmodel.common.PDRectangle;
-import org.pdfbox.pdmodel.interactive.action.PDAdditionalActions;
-import org.pdfbox.util.BitFlagHelper;
-import org.pdfbox.cos.COSBase;
-
-/**
- * This class represents a PDF annotation.
- *
- * @author Ben Litchfield (ben@benlitchfield.com)
- * @version $Revision: 1.10 $
- */
-public abstract class PDAnnotation implements COSObjectable
-{
- /**
- * An annotation flag.
- */
- public static final int FLAG_INVISIBLE = 1 << 0;
- /**
- * An annotation flag.
- */
- public static final int FLAG_HIDDEN = 1 << 1;
- /**
- * An annotation flag.
- */
- public static final int FLAG_PRINTED = 1 << 2;
- /**
- * An annotation flag.
- */
- public static final int FLAG_NO_ZOOM = 1 << 3;
- /**
- * An annotation flag.
- */
- public static final int FLAG_NO_ROTATE = 1 << 4;
- /**
- * An annotation flag.
- */
- public static final int FLAG_NO_VIEW = 1 << 5;
- /**
- * An annotation flag.
- */
- public static final int FLAG_READ_ONLY = 1 << 6;
- /**
- * An annotation flag.
- */
- public static final int FLAG_LOCKED = 1 << 7;
- /**
- * An annotation flag.
- */
- public static final int FLAG_TOGGLE_NO_VIEW = 1 << 8;
-
-
-
- private COSDictionary dictionary;
-
- /**
- * Create the correct annotation from the base COS object.
- *
- * @param base The COS object that is the annotation.
- * @return The correctly typed annotation object.
- * @throws IOException If there is an error while creating the annotation.
- */
- public static PDAnnotation createAnnotation( COSBase base ) throws IOException
- {
- PDAnnotation annot = null;
- if( base instanceof COSDictionary )
- {
- COSDictionary annotDic = (COSDictionary)base;
- String subtype = annotDic.getString( COSName.SUBTYPE );
- if( subtype.equals( PDAnnotationRubberStamp.SUB_TYPE ) )
- {
- annot = new PDAnnotationRubberStamp(annotDic);
- }
- else
- {
- annot = new PDAnnotationUnknown( annotDic );
- }
- }
- else
- {
- throw new IOException( "Error: Unknown annotation type " + base );
- }
-
- return annot;
- }
-
- /**
- * Constructor.
- */
- public PDAnnotation()
- {
- dictionary = new COSDictionary();
- dictionary.setItem( COSName.TYPE, COSName.getPDFName( "Annot" ) );
- }
-
- /**
- * Constructor.
- *
- * @param dict The annotations dictionary.
- */
- public PDAnnotation( COSDictionary dict )
- {
- dictionary = dict;
- }
-
- /**
- * returns the dictionary.
- * @return the dictionary
- */
- public COSDictionary getDictionary()
- {
- return dictionary;
- }
-
- /**
- * The annotation rectangle, defining the location of the annotation
- * on the page in default user space units. This is usually required and should
- * not return null on valid PDF documents. But where this is a parent form field
- * with children, such as radio button collections then the rectangle will be null.
- *
- * @return The Rect value of this annotation.
- */
- public PDRectangle getRectangle()
- {
- COSArray rectArray = (COSArray)dictionary.getDictionaryObject( COSName.getPDFName( "Rect" ) );
- PDRectangle rectangle = null;
- if( rectArray != null )
- {
- rectangle = new PDRectangle( rectArray );
- }
- return rectangle;
- }
-
- /**
- * This will set the rectangle for this annotation.
- *
- * @param rectangle The new rectangle values.
- */
- public void setRectangle( PDRectangle rectangle )
- {
- dictionary.setItem( COSName.getPDFName( "Rect" ), rectangle.getCOSArray() );
- }
-
- /**
- * This will get the flags for this field.
- *
- * @return flags The set of flags.
- */
- public int getAnnotationFlags()
- {
- return getDictionary().getInt( "F", 0 );
- }
-
- /**
- * This will set the flags for this field.
- *
- * @param flags The new flags.
- */
- public void setAnnotationFlags( int flags )
- {
- getDictionary().setInt( "F", flags );
- }
-
- /**
- * Interface method for COSObjectable.
- *
- * @return This object as a standard COS object.
- */
- public COSBase getCOSObject()
- {
- return getDictionary();
- }
-
- /**
- * This will get the name of the current appearance stream if any.
- *
- * @return The name of the appearance stream.
- */
- public String getAppearanceStream()
- {
- String retval = null;
- COSName name = (COSName)getDictionary().getDictionaryObject( COSName.getPDFName( "AS" ) );
- if( name != null )
- {
- retval = name.getName();
- }
- return retval;
- }
-
- /**
- * This will set the annotations appearance stream name.
- *
- * @param as The name of the appearance stream.
- */
- public void setAppearanceStream( String as )
- {
- if( as == null )
- {
- getDictionary().removeItem( COSName.getPDFName( "AS" ) );
- }
- else
- {
- getDictionary().setItem( COSName.getPDFName( "AS" ), COSName.getPDFName( as ) );
- }
- }
-
- /**
- * This will get the appearance dictionary associated with this annotation.
- * This may return null.
- *
- * @return This annotations appearance.
- */
- public PDAppearanceDictionary getAppearance()
- {
- PDAppearanceDictionary ap = null;
- COSDictionary apDic = (COSDictionary)dictionary.getDictionaryObject( COSName.getPDFName( "AP" ) );
- if( apDic != null )
- {
- ap = new PDAppearanceDictionary( apDic );
- }
- return ap;
- }
-
- /**
- * This will set the appearance associated with this annotation.
- *
- * @param appearance The appearance dictionary for this annotation.
- */
- public void setAppearance( PDAppearanceDictionary appearance )
- {
- COSDictionary ap = null;
- if( appearance != null )
- {
- ap = appearance.getDictionary();
- }
- dictionary.setItem( COSName.getPDFName( "AP" ), ap );
- }
-
- /**
- * Get the invisible flag.
- *
- * @return The invisible flag.
- */
- public boolean isInvisible()
- {
- return BitFlagHelper.getFlag( getDictionary(), "F", FLAG_INVISIBLE );
- }
-
- /**
- * Set the invisible flag.
- *
- * @param invisible The new invisible flag.
- */
- public void setInvisible( boolean invisible )
- {
- BitFlagHelper.setFlag( getDictionary(), "F", FLAG_INVISIBLE, invisible );
- }
-
- /**
- * Get the hidden flag.
- *
- * @return The hidden flag.
- */
- public boolean isHidden()
- {
- return BitFlagHelper.getFlag( getDictionary(), "F", FLAG_HIDDEN );
- }
-
- /**
- * Set the hidden flag.
- *
- * @param hidden The new hidden flag.
- */
- public void setHidden( boolean hidden )
- {
- BitFlagHelper.setFlag( getDictionary(), "F", FLAG_HIDDEN, hidden );
- }
-
- /**
- * Get the printed flag.
- *
- * @return The printed flag.
- */
- public boolean isPrinted()
- {
- return BitFlagHelper.getFlag( getDictionary(), "F", FLAG_PRINTED );
- }
-
- /**
- * Set the printed flag.
- *
- * @param printed The new printed flag.
- */
- public void setPrinted( boolean printed )
- {
- BitFlagHelper.setFlag( getDictionary(), "F", FLAG_PRINTED, printed );
- }
-
- /**
- * Get the noZoom flag.
- *
- * @return The noZoom flag.
- */
- public boolean isNoZoom()
- {
- return BitFlagHelper.getFlag( getDictionary(), "F", FLAG_NO_ZOOM );
- }
-
- /**
- * Set the noZoom flag.
- *
- * @param noZoom The new noZoom flag.
- */
- public void setNoZoom( boolean noZoom )
- {
- BitFlagHelper.setFlag( getDictionary(), "F", FLAG_NO_ZOOM, noZoom );
- }
-
- /**
- * Get the noRotate flag.
- *
- * @return The noRotate flag.
- */
- public boolean isNoRotate()
- {
- return BitFlagHelper.getFlag( getDictionary(), "F", FLAG_NO_ROTATE );
- }
-
- /**
- * Set the noRotate flag.
- *
- * @param noRotate The new noRotate flag.
- */
- public void setNoRotate( boolean noRotate )
- {
- BitFlagHelper.setFlag( getDictionary(), "F", FLAG_NO_ROTATE, noRotate );
- }
-
- /**
- * Get the noView flag.
- *
- * @return The noView flag.
- */
- public boolean isNoView()
- {
- return BitFlagHelper.getFlag( getDictionary(), "F", FLAG_NO_VIEW );
- }
-
- /**
- * Set the noView flag.
- *
- * @param noView The new noView flag.
- */
- public void setNoView( boolean noView )
- {
- BitFlagHelper.setFlag( getDictionary(), "F", FLAG_NO_VIEW, noView );
- }
-
- /**
- * Get the readOnly flag.
- *
- * @return The readOnly flag.
- */
- public boolean isReadOnly()
- {
- return BitFlagHelper.getFlag( getDictionary(), "F", FLAG_READ_ONLY );
- }
-
- /**
- * Set the readOnly flag.
- *
- * @param readOnly The new readOnly flag.
- */
- public void setReadOnly( boolean readOnly )
- {
- BitFlagHelper.setFlag( getDictionary(), "F", FLAG_READ_ONLY, readOnly );
- }
-
- /**
- * Get the locked flag.
- *
- * @return The locked flag.
- */
- public boolean isLocked()
- {
- return BitFlagHelper.getFlag( getDictionary(), "F", FLAG_LOCKED );
- }
-
- /**
- * Set the locked flag.
- *
- * @param locked The new locked flag.
- */
- public void setLocked( boolean locked )
- {
- BitFlagHelper.setFlag( getDictionary(), "F", FLAG_LOCKED, locked );
- }
-
- /**
- * Get the toggleNoView flag.
- *
- * @return The toggleNoView flag.
- */
- public boolean isToggleNoView()
- {
- return BitFlagHelper.getFlag( getDictionary(), "F", FLAG_TOGGLE_NO_VIEW );
- }
-
- /**
- * Set the toggleNoView flag.
- *
- * @param toggleNoView The new toggleNoView flag.
- */
- public void setToggleNoView( boolean toggleNoView )
- {
- BitFlagHelper.setFlag( getDictionary(), "F", FLAG_TOGGLE_NO_VIEW, toggleNoView );
- }
-
- /**
- * Get the additional actions for this field. This will return null
- * if there are no additional actions for this field.
- *
- * @return The actions of the field.
- */
- public PDAdditionalActions getActions()
- {
- COSDictionary aa = (COSDictionary)dictionary.getDictionaryObject( "AA" );
- PDAdditionalActions retval = null;
- if( aa != null )
- {
- retval = new PDAdditionalActions( aa );
- }
- return retval;
- }
-
- /**
- * Set the actions of the field.
- *
- * @param actions The field actions.
- */
- public void setActions( PDAdditionalActions actions )
- {
- dictionary.setItem( "AA", actions );
- }
-
- /**
- * Get the "contents" of the field.
- *
- * @return the value of the contents
- */
- public String getContents()
- {
- return dictionary.getString(COSName.CONTENTS);
- }
-
- /**
- * Set the "contents" of the field.
- *
- * @param value the value of the contents.
- */
- public void setContents( String value)
- {
- dictionary.setString(COSName.CONTENTS, value);
- }
-} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAnnotationRubberStamp.java b/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAnnotationRubberStamp.java
deleted file mode 100644
index 089b19f..0000000
--- a/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAnnotationRubberStamp.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/**
- * Copyright (c) 2003, 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.annotation;
-
-import org.pdfbox.cos.COSDictionary;
-import org.pdfbox.cos.COSName;
-
-/**
- * This is the class that represents a widget.
- *
- * @author Paul King
- * @version $Revision: 1.1 $
- */
-public class PDAnnotationRubberStamp extends PDAnnotation
-{
-
- /*
- * The various values of the rubber stamp as defined in
- * the PDF 1.6 reference Table 8.28
- */
-
- /**
- * Constant for the name of a rubber stamp.
- */
- public static final String NAME_APPROVED = "Approved";
- /**
- * Constant for the name of a rubber stamp.
- */
- public static final String NAME_EXPERIMENTAL = "Experimental";
- /**
- * Constant for the name of a rubber stamp.
- */
- public static final String NAME_NOT_APPROVED = "NotApproved";
- /**
- * Constant for the name of a rubber stamp.
- */
- public static final String NAME_AS_IS = "AsIs";
- /**
- * Constant for the name of a rubber stamp.
- */
- public static final String NAME_EXPIRED = "Expired";
- /**
- * Constant for the name of a rubber stamp.
- */
- public static final String NAME_NOT_FOR_PUBLIC_RELEASE = "NotForPublicRelease";
- /**
- * Constant for the name of a rubber stamp.
- */
- public static final String NAME_FOR_PUBLIC_RELEASE = "ForPublicRelease";
- /**
- * Constant for the name of a rubber stamp.
- */
- public static final String NAME_DRAFT = "Draft";
- /**
- * Constant for the name of a rubber stamp.
- */
- public static final String NAME_FOR_COMMENT = "ForComment";
- /**
- * Constant for the name of a rubber stamp.
- */
- public static final String NAME_TOP_SECRET = "TopSecret";
- /**
- * Constant for the name of a rubber stamp.
- */
- public static final String NAME_DEPARTMENTAL = "Departmental";
- /**
- * Constant for the name of a rubber stamp.
- */
- public static final String NAME_CONFIDENTIAL = "Confidential";
- /**
- * Constant for the name of a rubber stamp.
- */
- public static final String NAME_FINAL = "Final";
- /**
- * Constant for the name of a rubber stamp.
- */
- public static final String NAME_SOLD = "Sold";
-
- /**
- * The type of annotation.
- */
- public static final String SUB_TYPE = "Stamp";
-
- /**
- * Constructor.
- */
- public PDAnnotationRubberStamp()
- {
- super();
- getDictionary().setItem( COSName.SUBTYPE, COSName.getPDFName( SUB_TYPE ) );
- }
-
- /**
- * Creates a Rubber Stamp annotation from a COSDictionary, expected to be
- * a correct object definition.
- *
- * @param field the PDF objet to represent as a field.
- */
- public PDAnnotationRubberStamp(COSDictionary field)
- {
- super( field );
- }
-
- /**
- * This will set the name (and hence appearance, AP taking precedence)
- * For this annotation. See the NAME_XXX constants for valid values.
- *
- * @param name The name of the rubber stamp.
- */
- public void setName( String name )
- {
- getDictionary().setName(COSName.NAME, name);
- }
-
- /**
- * This will retrieve the name (and hence appearance, AP taking precedence)
- * For this annotation. The default is DRAFT.
- *
- * @return The name of this rubber stamp, see the NAME_XXX constants.
- */
- public String getName()
- {
- return getDictionary().getNameAsString(COSName.NAME, NAME_DRAFT);
- }
-} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAnnotationUnknown.java b/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAnnotationUnknown.java
deleted file mode 100644
index 408f5fb..0000000
--- a/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAnnotationUnknown.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Copyright (c) 2003, 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.annotation;
-
-import org.pdfbox.cos.COSDictionary;
-
-/**
- * This is the class that represents an arbitary Unknown Annotation type.
- *
- * @author Paul King
- * @version $Revision: 1.1 $
- */
-public class PDAnnotationUnknown extends PDAnnotation
-{
-
- /**
- * Creates an arbitary annotation from a COSDictionary, expected to be
- * a correct object definition for some sort of annotation.
- *
- * @param dic The dictionary which represents this Annotation.
- */
- public PDAnnotationUnknown(COSDictionary dic)
- {
- super( dic );
- }
-} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAnnotationWidget.java b/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAnnotationWidget.java
deleted file mode 100644
index 5faf983..0000000
--- a/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAnnotationWidget.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Copyright (c) 2003, 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.annotation;
-
-import org.pdfbox.cos.COSDictionary;
-import org.pdfbox.cos.COSName;
-
-/**
- * This is the class that represents a widget.
- *
- * @author Ben Litchfield (ben@csh.rit.edu)
- * @version $Revision: 1.1 $
- */
-public class PDAnnotationWidget extends PDAnnotation
-{
-
- /**
- * Constructor.
- */
- public PDAnnotationWidget()
- {
- super();
- getDictionary().setItem( COSName.SUBTYPE, COSName.getPDFName( "Widget" ) );
- }
-
-
- /**
- * Creates a PDWidget from a COSDictionary, expected to be
- * a correct object definition for a field in PDF.
- *
- * @param field the PDF objet to represent as a field.
- */
- public PDAnnotationWidget(COSDictionary field)
- {
- super( field );
- }
-} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAppearanceDictionary.java b/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAppearanceDictionary.java
deleted file mode 100644
index da3a182..0000000
--- a/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAppearanceDictionary.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/**
- * Copyright (c) 2003-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.annotation;
-
-import org.pdfbox.cos.COSBase;
-import org.pdfbox.cos.COSDictionary;
-import org.pdfbox.cos.COSName;
-import org.pdfbox.cos.COSStream;
-
-import org.pdfbox.pdmodel.common.COSObjectable;
-import org.pdfbox.pdmodel.common.COSDictionaryMap;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * This class represents a PDF /AP entry the appearance dictionary.
- *
- * @author Ben Litchfield (ben@csh.rit.edu)
- * @version $Revision: 1.3 $
- */
-public class PDAppearanceDictionary implements COSObjectable
-{
- private COSDictionary dictionary;
-
- /**
- * Constructor.
- */
- public PDAppearanceDictionary()
- {
- dictionary = new COSDictionary();
- //the N entry is required.
- dictionary.setItem( COSName.getPDFName( "N" ), new COSDictionary() );
- }
-
- /**
- * Constructor.
- *
- * @param dict The annotations dictionary.
- */
- public PDAppearanceDictionary( COSDictionary dict )
- {
- dictionary = dict;
- }
-
- /**
- * returns the dictionary.
- * @return the dictionary
- */
- public COSDictionary getDictionary()
- {
- return dictionary;
- }
-
- /**
- * returns the dictionary.
- * @return the dictionary
- */
- public COSBase getCOSObject()
- {
- return dictionary;
- }
-
- /**
- * This will return a list of appearances. In the case where there is
- * only one appearance the map will contain one entry whose key is the string
- * "default".
- *
- * @return A list of key(java.lang.String) value(PDAppearanceStream) pairs
- */
- public Map getNormalAppearance()
- {
- COSBase ap = dictionary.getDictionaryObject( COSName.getPDFName( "N" ) );
- if( ap instanceof COSStream )
- {
- COSStream aux = (COSStream) ap;
- ap = new COSDictionary();
- ((COSDictionary)ap).setItem(COSName.getPDFName( "default" ), aux );
- }
- COSDictionary map = (COSDictionary)ap;
- Map actuals = new HashMap();
- Map retval = new COSDictionaryMap( actuals, map );
- Iterator asNames = map.keyList().iterator();
- while( asNames.hasNext() )
- {
- COSName asName = (COSName)asNames.next();
- COSStream as = (COSStream)map.getDictionaryObject( asName );
- actuals.put( asName.getName(), new PDAppearanceStream( as ) );
- }
-
- return retval;
- }
-
- /**
- * This will set a list of appearances. If you would like to set the single
- * appearance then you should use the key "default", and when the PDF is written
- * back to the filesystem then there will only be one stream.
- *
- * @param appearanceMap The updated map with the appearance.
- */
- public void setNormalAppearance( Map appearanceMap )
- {
- dictionary.setItem( COSName.getPDFName( "N" ), COSDictionaryMap.convert( appearanceMap ) );
- }
-
- /**
- * This will set the normal appearance when there is only one appearance
- * to be shown.
- *
- * @param ap The appearance stream to show.
- */
- public void setNormalAppearance( PDAppearanceStream ap )
- {
- dictionary.setItem( COSName.getPDFName( "N" ), ap.getStream() );
- }
-
- /**
- * This will return a list of appearances. In the case where there is
- * only one appearance the map will contain one entry whose key is the string
- * "default". If there is no rollover appearance then the normal appearance
- * will be returned. Which means that this method will never return null.
- *
- * @return A list of key(java.lang.String) value(PDAppearanceStream) pairs
- */
- public Map getRolloverAppearance()
- {
- Map retval = null;
- COSBase ap = dictionary.getDictionaryObject( COSName.getPDFName( "R" ) );
- if( ap == null )
- {
- retval = getNormalAppearance();
- }
- else
- {
- if( ap instanceof COSStream )
- {
- ap = new COSDictionary();
- ((COSDictionary)ap).setItem(COSName.getPDFName( "default" ), ap );
- }
- COSDictionary map = (COSDictionary)ap;
- Map actuals = new HashMap();
- retval = new COSDictionaryMap( actuals, map );
- Iterator asNames = map.keyList().iterator();
- while( asNames.hasNext() )
- {
- COSName asName = (COSName)asNames.next();
- COSStream as = (COSStream)map.getDictionaryObject( asName );
- actuals.put( asName.getName(), new PDAppearanceStream( as ) );
- }
- }
-
- return retval;
- }
-
- /**
- * This will set a list of appearances. If you would like to set the single
- * appearance then you should use the key "default", and when the PDF is written
- * back to the filesystem then there will only be one stream.
- *
- * @param appearanceMap The updated map with the appearance.
- */
- public void setRolloverAppearance( Map appearanceMap )
- {
- dictionary.setItem( COSName.getPDFName( "R" ), COSDictionaryMap.convert( appearanceMap ) );
- }
-
- /**
- * This will return a list of appearances. In the case where there is
- * only one appearance the map will contain one entry whose key is the string
- * "default". If there is no rollover appearance then the normal appearance
- * will be returned. Which means that this method will never return null.
- *
- * @return A list of key(java.lang.String) value(PDAppearanceStream) pairs
- */
- public Map getDownAppearance()
- {
- Map retval = null;
- COSBase ap = dictionary.getDictionaryObject( COSName.getPDFName( "D" ) );
- if( ap == null )
- {
- retval = getNormalAppearance();
- }
- else
- {
- if( ap instanceof COSStream )
- {
- ap = new COSDictionary();
- ((COSDictionary)ap).setItem(COSName.getPDFName( "default" ), ap );
- }
- COSDictionary map = (COSDictionary)ap;
- Map actuals = new HashMap();
- retval = new COSDictionaryMap( actuals, map );
- Iterator asNames = map.keyList().iterator();
- while( asNames.hasNext() )
- {
- COSName asName = (COSName)asNames.next();
- COSStream as = (COSStream)map.getDictionaryObject( asName );
- actuals.put( asName.getName(), new PDAppearanceStream( as ) );
- }
- }
-
- return retval;
- }
-
- /**
- * This will set a list of appearances. If you would like to set the single
- * appearance then you should use the key "default", and when the PDF is written
- * back to the filesystem then there will only be one stream.
- *
- * @param appearanceMap The updated map with the appearance.
- */
- public void setDownAppearance( Map appearanceMap )
- {
- dictionary.setItem( COSName.getPDFName( "D" ), COSDictionaryMap.convert( appearanceMap ) );
- }
-} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAppearanceStream.java b/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAppearanceStream.java
deleted file mode 100644
index ca3f4a4..0000000
--- a/src/main/java/org/pdfbox/pdmodel/interactive/annotation/PDAppearanceStream.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * Copyright (c) 2003-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.annotation;
-
-import org.pdfbox.cos.COSArray;
-import org.pdfbox.cos.COSBase;
-import org.pdfbox.cos.COSDictionary;
-import org.pdfbox.cos.COSName;
-import org.pdfbox.cos.COSStream;
-
-import org.pdfbox.pdmodel.common.PDRectangle;
-import org.pdfbox.pdmodel.common.COSObjectable;
-
-import org.pdfbox.pdmodel.PDResources;
-
-
-/**
- * This class represents an appearance for an annotation.
- *
- * @author Ben Litchfield (ben@csh.rit.edu)
- * @version $Revision: 1.3 $
- */
-public class PDAppearanceStream implements COSObjectable
-{
- private COSStream stream = null;
-
-
- /**
- * Constructor.
- *
- * @param s The cos stream for this appearance.
- */
- public PDAppearanceStream( COSStream s )
- {
- stream = s;
- }
-
- /**
- * This will return the underlying stream.
- *
- * @return The wrapped stream.
- */
- public COSStream getStream()
- {
- return stream;
- }
-
- /**
- * @see COSObjectable#getCOSObject()
- */
- public COSBase getCOSObject()
- {
- return stream;
- }
-
- /**
- * Get the bounding box for this appearance. This may return null in which
- * case the Rectangle from the annotation should be used.
- *
- * @return The bounding box for this appearance.
- */
- public PDRectangle getBoundingBox()
- {
- PDRectangle box = null;
- COSArray bbox = (COSArray)stream.getDictionaryObject( COSName.getPDFName( "BBox" ) );
- if( bbox != null )
- {
- box = new PDRectangle( bbox );
- }
- return box;
- }
-
- /**
- * This will set the bounding box for this appearance stream.
- *
- * @param rectangle The new bounding box.
- */
- public void setBoundingBox( PDRectangle rectangle )
- {
- COSArray array = null;
- if( rectangle != null )
- {
- array = rectangle.getCOSArray();
- }
- stream.setItem( COSName.getPDFName( "BBox" ), array );
- }
-
- /**
- * This will get the resources for this appearance stream.
- *
- * @return The appearance stream resources.
- */
- public PDResources getResources()
- {
- PDResources retval = null;
- COSDictionary dict = (COSDictionary)stream.getDictionaryObject( COSName.RESOURCES );
- if( dict != null )
- {
- retval = new PDResources( dict );
- }
- return retval;
- }
-
- /**
- * This will set the new resources.
- *
- * @param resources The new resources.
- */
- public void setResources( PDResources resources )
- {
- COSDictionary dict = null;
- if( resources != null )
- {
- dict = resources.getCOSDictionary();
- }
- stream.setItem( COSName.RESOURCES, dict );
- }
-} \ No newline at end of file
diff --git a/src/main/java/org/pdfbox/pdmodel/interactive/annotation/package.html b/src/main/java/org/pdfbox/pdmodel/interactive/annotation/package.html
deleted file mode 100644
index 4d9fdeb..0000000
--- a/src/main/java/org/pdfbox/pdmodel/interactive/annotation/package.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-
-</head>
-<body>
-The annotation package contains classes that work with PDF annotation elements.
-</body>
-</html>