Class 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 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 associated
        name - The name by which the destination is referred to.
        target - The target destination
        Returns:
        The newly created named destination.
        Throws:
        java.lang.IllegalArgumentException - if the targetDocument argument has already been closed
        java.lang.IllegalArgumentException - if the targetDocument argument is read-only
        java.lang.IllegalArgumentException - if the document associated with the target argument has already been closed
        java.lang.IllegalArgumentException - if the target argument belongs to a different document
        java.lang.IllegalArgumentException - if targetDocument is null
        java.lang.IllegalArgumentException - if name is null
        java.lang.IllegalArgumentException - if target is null
      • 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.