Class PDPageDestination

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected COSArray array
      Storage for the page destination.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected PDPageDestination()
      Constructor to create empty page destination.
      protected PDPageDestination​(COSArray arr)
      Constructor to create empty page destination.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      COSArray getCOSObject()
      Convert this standard java object to a COS object.
      PDPage getPage()
      This will get the page for this destination.
      int getPageNumber()
      This will get the page number for this destination.
      private int indexOfPageTree​(COSDictionary pageDict)  
      int retrievePageNumber()
      Returns the page number for this destination, regardless of whether this is a page number or a reference to a page.
      void setPage​(PDPage page)
      Set the page for a local destination.
      void setPageNumber​(int pageNumber)
      Set the page number for a remote destination.
      • Methods inherited from class org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination

        create
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • array

        protected final COSArray array
        Storage for the page destination.
    • Constructor Detail

      • PDPageDestination

        protected PDPageDestination()
        Constructor to create empty page destination.
      • PDPageDestination

        protected PDPageDestination​(COSArray arr)
        Constructor to create empty page destination.
        Parameters:
        arr - A page destination array.
    • Method Detail

      • getPage

        public PDPage getPage()
        This will get the page for this destination. A page destination can either reference a page (for a local destination) or a page number (when doing a remote destination to another PDF). If this object is referencing by page number then this method will return null and getPageNumber() should be used.
        Returns:
        The page for this destination.
      • setPage

        public void setPage​(PDPage page)
        Set the page for a local destination. For an external destination, call setPageNumber(int pageNumber).
        Parameters:
        page - The page for a local destination.
      • getPageNumber

        public int getPageNumber()
        This will get the page number for this destination. A page destination can either reference a page (for a local destination) or a page number (when doing a remote destination to another PDF). If this object is referencing by page number then this method will return that number, otherwise -1 will be returned.
        Returns:
        The zero-based page number for this destination.
      • retrievePageNumber

        public int retrievePageNumber()
        Returns the page number for this destination, regardless of whether this is a page number or a reference to a page.
        Returns:
        the 0-based page number, or -1 if the destination type is unknown.
        See Also:
        PDOutlineItem
      • indexOfPageTree

        private int indexOfPageTree​(COSDictionary pageDict)
      • setPageNumber

        public void setPageNumber​(int pageNumber)
        Set the page number for a remote destination. For an internal destination, call setPage(PDPage page).
        Parameters:
        pageNumber - The page for a remote destination.
      • getCOSObject

        public COSArray getCOSObject()
        Convert this standard java object to a COS object.
        Returns:
        The cos object that matches this Java object.