Class PdfReader.PageRefs

  • Enclosing class:
    PdfReader

    static class PdfReader.PageRefs
    extends java.lang.Object
    • Field Detail

      • refsn

        private java.util.List<PdfObject> refsn
        ArrayList with the indirect references to every page. Element 0 = page 1; 1 = page 2;... Not used for partial reading.
      • sizep

        private int sizep
        The number of pages, updated only in case of partial reading.
      • refsp

        private IntHashtable refsp
        intHashtable that does the same thing as refsn in case of partial reading: major difference: not all the pages are read.
      • lastPageRead

        private int lastPageRead
        Page number of the last page that was read (partial reading only)
      • pageInh

        private java.util.List<PdfDictionary> pageInh
        stack to which pages dictionaries are pushed to keep track of the current page attributes
      • keepPages

        private boolean keepPages
    • Method Detail

      • size

        int size()
      • readPages

        void readPages()
      • reReadPages

        void reReadPages()
      • getPageN

        public PdfDictionary getPageN​(int pageNum)
        Gets the page dictionary of the specified page
        Parameters:
        pageNum - the page number. 1 is the first
        Returns:
        the page dictionary
      • getPageNRelease

        public PdfDictionary getPageNRelease​(int pageNum)
        Gets the page reference to this page.
        Parameters:
        pageNum - the page number.
        Returns:
        a dictionary object or null when the page does not exist
      • getPageOrigRefRelease

        public PRIndirectReference getPageOrigRefRelease​(int pageNum)
        Releases the page reference to this page.
        Parameters:
        pageNum - the page number.
        Returns:
        an indirect reference
      • getPageOrigRef

        public PRIndirectReference getPageOrigRef​(int pageNum)
        Gets the page reference to this page.
        Parameters:
        pageNum - the page number. 1 is the first
        Returns:
        the page reference or null if the page does not exist
      • keepPages

        void keepPages()
      • releasePage

        public void releasePage​(int pageNum)
      • resetReleasePage

        public void resetReleasePage()
      • pushPageAttributes

        private void pushPageAttributes​(PdfDictionary nodePages)
        Adds a PdfDictionary to the pageInh stack to keep track of the page attributes.
        Parameters:
        nodePages - a Pages dictionary
      • popPageAttributes

        private void popPageAttributes()
        Removes the last PdfDictionary that was pushed to the pageInh stack.
      • iteratePages

        private void iteratePages​(PdfDictionary page)
      • selectPages

        private void selectPages​(java.util.List<java.lang.Integer> pagesToKeep)