Class PDPageTree

    • Constructor Detail

      • PDPageTree

        public PDPageTree()
        Constructor for embedding.
      • PDPageTree

        public PDPageTree​(COSDictionary root)
        Constructor for reading.
        Parameters:
        root - A page tree root.
    • Method Detail

      • getInheritableAttribute

        public static COSBase getInheritableAttribute​(COSDictionary node,
                                                      COSName key)
        Returns the given attribute, inheriting from parent tree nodes if necessary.
        Parameters:
        node - page object
        key - the key to look up
        Returns:
        COS value for the given key
      • get

        public PDPage get​(int index)
        Returns the page at the given index.
        Parameters:
        index - zero-based index
      • indexOf

        public int indexOf​(PDPage page)
        Returns the index of the given page, or -1 if it does not exist.
        Parameters:
        page - The page to search for.
        Returns:
        the zero-based index of the given page, or -1 if the page is not found.
      • getCount

        public int getCount()
        Returns the number of leaf nodes (page objects) that are descendants of this root within the page tree.
      • getCOSObject

        public COSDictionary getCOSObject()
        Description copied from interface: COSObjectable
        Convert this standard java object to a COS object.
        Specified by:
        getCOSObject in interface COSObjectable
        Returns:
        The cos object that matches this Java object.
      • remove

        public void remove​(int index)
        Removes the page with the given index from the page tree.
        Parameters:
        index - zero-based page index
      • remove

        public void remove​(PDPage page)
        Removes the given page from the page tree.
        Parameters:
        page - The page to remove.
      • add

        public void add​(PDPage page)
        Adds the given page to this page tree.
        Parameters:
        page - The page to add.