Class NamedDestination
- java.lang.Object
-
- com.pdftools.toolbox.internal.NativeBase
-
- com.pdftools.toolbox.internal.NativeObject
-
- com.pdftools.toolbox.pdf.navigation.Destination
-
- com.pdftools.toolbox.pdf.navigation.NamedDestination
-
public class NamedDestination extends Destination
A named destination that can be referred by name. Named destinations have two advantages compared to direct destinations:- The name can be used in web links, e.g. http://www.example.com/document.pdf#destinationname
- If the target destination of a named destination is changed, all occurrences automatically point ot the new target.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NamedDestination
create(Document targetDocument, java.lang.String name, DirectDestination target)
Create a named destinationjava.lang.String
getName()
The name by which the destination is referred to.-
Methods inherited from class com.pdftools.toolbox.pdf.navigation.Destination
getTarget
-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
create
public static NamedDestination create(Document targetDocument, java.lang.String name, DirectDestination target)
Create a named destination
The returned object is not yet used on any page, but it is associated with the given target document.- Parameters:
targetDocument
- The output document with which the returned object is associatedname
- The name by which the destination is referred to.target
- The target destination- Returns:
- The newly created named destination.
- Throws:
java.lang.IllegalArgumentException
- if thetargetDocument
argument has already been closedjava.lang.IllegalArgumentException
- if thetargetDocument
argument is read-onlyjava.lang.IllegalArgumentException
- if the document associated with thetarget
argument has already been closedjava.lang.IllegalArgumentException
- if thetarget
argument belongs to a different documentjava.lang.IllegalArgumentException
- iftargetDocument
isnull
java.lang.IllegalArgumentException
- ifname
isnull
java.lang.IllegalArgumentException
- iftarget
isnull
-
getName
public java.lang.String getName()
The name by which the destination is referred to.- Throws:
java.lang.IllegalStateException
- the object has already been closed.java.lang.IllegalStateException
- the associated document has already been closed.
-
-