org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination
abstract public class: PDDestination [javadoc |
source]
java.lang.Object
org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination
All Implemented Interfaces:
PDDestinationOrAction
Direct Known Subclasses:
PDPageXYZDestination, PDPageFitWidthDestination, PDPageFitRectangleDestination, PDNamedDestination, PDPageFitDestination, PDPageDestination, PDPageFitHeightDestination
This represents a destination in a PDF document.
Method from org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination Summary: |
---|
create, toString |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination Detail: |
public static PDDestination create(COSBase base) throws IOException {
PDDestination retval = null;
if( base == null )
{
//this is ok, just return null.
}
else if( base instanceof COSArray && ((COSArray)base).size() > 0 )
{
COSArray array = (COSArray)base;
COSName type = (COSName)array.getObject( 1 );
String typeString = type.getName();
if( typeString.equals( PDPageFitDestination.TYPE ) ||
typeString.equals( PDPageFitDestination.TYPE_BOUNDED ))
{
retval = new PDPageFitDestination( array );
}
else if( typeString.equals( PDPageFitHeightDestination.TYPE ) ||
typeString.equals( PDPageFitHeightDestination.TYPE_BOUNDED ))
{
retval = new PDPageFitHeightDestination( array );
}
else if( typeString.equals( PDPageFitRectangleDestination.TYPE ) )
{
retval = new PDPageFitRectangleDestination( array );
}
else if( typeString.equals( PDPageFitWidthDestination.TYPE ) ||
typeString.equals( PDPageFitWidthDestination.TYPE_BOUNDED ))
{
retval = new PDPageFitWidthDestination( array );
}
else if( typeString.equals( PDPageXYZDestination.TYPE ) )
{
retval = new PDPageXYZDestination( array );
}
else
{
throw new IOException( "Unknown destination type:" + type );
}
}
else if( base instanceof COSString )
{
retval = new PDNamedDestination( (COSString)base );
}
else if( base instanceof COSName )
{
retval = new PDNamedDestination( (COSName)base );
}
else
{
throw new IOException( "Error: can't convert to Destination " + base );
}
return retval;
}
This will create a new destination depending on the type of COSBase
that is passed in. |
public String toString() {
return super.toString();
}
Return a string representation of this class. |