Class NamedDestination
- java.lang.Object
-
- com.pdf_tools.fourheights.pdftoolbox.internal.NativeBase
-
- com.pdf_tools.fourheights.pdftoolbox.internal.NativeObject
-
- com.pdf_tools.fourheights.pdftoolbox.pdf.navigation.Destination
-
- com.pdf_tools.fourheights.pdftoolbox.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.pdf_tools.fourheights.pdftoolbox.pdf.navigation.Destination
getTarget
-
Methods inherited from class com.pdf_tools.fourheights.pdftoolbox.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.
-
-