Package com.itextpdf.text.pdf
Class PdfReader.PageRefs
- java.lang.Object
-
- com.itextpdf.text.pdf.PdfReader.PageRefs
-
- Enclosing class:
- PdfReader
static class PdfReader.PageRefs extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
keepPages
private int
lastPageRead
Page number of the last page that was read (partial reading only)private java.util.ArrayList<PdfDictionary>
pageInh
stack to which pages dictionaries are pushed to keep track of the current page attributesprivate java.util.Set<PdfObject>
pagesNodes
Keeps track of all pages nodes to avoid circular references.private PdfReader
reader
private java.util.ArrayList<PRIndirectReference>
refsn
ArrayList with the indirect references to every page.private IntHashtable
refsp
intHashtable that does the same thing as refsn in case of partial reading: major difference: not all the pages are read.private int
sizep
The number of pages, updated only in case of partial reading.
-
Constructor Summary
Constructors Modifier Constructor Description private
PageRefs(PdfReader reader)
(package private)
PageRefs(PdfReader.PageRefs other, PdfReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PdfDictionary
getPageN(int pageNum)
Gets the dictionary that represents a page.PdfDictionary
getPageNRelease(int pageNum)
PRIndirectReference
getPageOrigRef(int pageNum)
Gets the page reference to this page.PRIndirectReference
getPageOrigRefRelease(int pageNum)
protected PRIndirectReference
getSinglePage(int n)
(package private) void
insertPage(int pageNum, PRIndirectReference ref)
private void
iteratePages(PRIndirectReference rpage)
(package private) void
keepPages()
private void
popPageAttributes()
Removes the last PdfDictionary that was pushed to the pageInh stack.private void
pushPageAttributes(PdfDictionary nodePages)
Adds a PdfDictionary to the pageInh stack to keep track of the page attributes.(package private) void
readPages()
void
releasePage(int pageNum)
(package private) void
reReadPages()
void
resetReleasePage()
private void
selectPages(java.util.List<java.lang.Integer> pagesToKeep)
(package private) int
size()
-
-
-
Field Detail
-
reader
private final PdfReader reader
-
refsn
private java.util.ArrayList<PRIndirectReference> 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.ArrayList<PdfDictionary> pageInh
stack to which pages dictionaries are pushed to keep track of the current page attributes
-
keepPages
private boolean keepPages
-
pagesNodes
private java.util.Set<PdfObject> pagesNodes
Keeps track of all pages nodes to avoid circular references.
-
-
Constructor Detail
-
PageRefs
private PageRefs(PdfReader reader) throws java.io.IOException
- Throws:
java.io.IOException
-
PageRefs
PageRefs(PdfReader.PageRefs other, PdfReader reader)
-
-
Method Detail
-
size
int size()
-
readPages
void readPages() throws java.io.IOException
- Throws:
java.io.IOException
-
reReadPages
void reReadPages() throws java.io.IOException
- Throws:
java.io.IOException
-
getPageN
public PdfDictionary getPageN(int pageNum)
Gets the dictionary that represents a page.- Parameters:
pageNum
- the page number. 1 is the first- Returns:
- the page dictionary
-
getPageNRelease
public PdfDictionary getPageNRelease(int pageNum)
- Parameters:
pageNum
-- Returns:
- a dictionary object
-
getPageOrigRefRelease
public PRIndirectReference getPageOrigRefRelease(int pageNum)
- Parameters:
pageNum
-- 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
-
keepPages
void keepPages()
-
releasePage
public void releasePage(int pageNum)
- Parameters:
pageNum
-
-
resetReleasePage
public void resetReleasePage()
-
insertPage
void insertPage(int pageNum, PRIndirectReference ref)
-
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(PRIndirectReference rpage) throws java.io.IOException
- Throws:
java.io.IOException
-
getSinglePage
protected PRIndirectReference getSinglePage(int n)
-
selectPages
private void selectPages(java.util.List<java.lang.Integer> pagesToKeep)
-
-