PJX

com.etymon.pjx.util
Class PdfPageTree

java.lang.Object
  extended bycom.etymon.pjx.util.PdfPageTree

public class PdfPageTree
extends java.lang.Object

Provides methods for retrieving and modifying the page tree of a PDF document. This class is synchronized.


Constructor Summary
PdfPageTree(PdfManager manager)
          Constructs a PdfPageTree instance based on a specified PdfManager.
 
Method Summary
 int getNumberOfPages()
          Returns the number of pages in the document.
 PdfReference getPage(int pageNumber)
          Returns an indirect reference to a page object specified by page number.
 PdfReference getRoot()
          Returns an indirect reference to the root node of the document's page tree.
 PdfDictionary inheritAttributes(PdfDictionary page)
          Adds inherited attributes to a specified page dictionary object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PdfPageTree

public PdfPageTree(PdfManager manager)
Constructs a PdfPageTree instance based on a specified PdfManager.

Method Detail

getPage

public PdfReference getPage(int pageNumber)
                     throws java.io.IOException,
                            PdfFormatException
Returns an indirect reference to a page object specified by page number. Note that page objects do not include inherited attributes; inheritAttributes(PdfDictionary) should be used to obtain inherited attributes.

Parameters:
pageNumber - the page number. The numbering starts with 0.
Returns:
the indirect reference.
Throws:
java.io.IOException
PdfFormatException

getNumberOfPages

public int getNumberOfPages()
                     throws java.io.IOException,
                            PdfFormatException
Returns the number of pages in the document.

Returns:
the number of pages.
Throws:
java.io.IOException
PdfFormatException

getRoot

public PdfReference getRoot()
                     throws java.io.IOException,
                            PdfFormatException
Returns an indirect reference to the root node of the document's page tree.

Returns:
the indirect reference.
Throws:
java.io.IOException
PdfFormatException

inheritAttributes

public PdfDictionary inheritAttributes(PdfDictionary page)
                                throws java.io.IOException,
                                       PdfFormatException
Adds inherited attributes to a specified page dictionary object. The page object is cloned and the inherited attributes are made explicit in the cloned object's dictionary. The inherited attributes are retrieved by ascending the page tree and looking for inheritable attributes (if any) that are missing from the specified page dictionary.

Parameters:
page - the page dictionary to be filled in with inherited attributes.
Returns:
a clone of the specified page dictionary, with all inherited attributes filled in.
Throws:
java.io.IOException
PdfFormatException

Copyright © 1998-2004 Etymon Systems, Inc.

The PDF data structures, operators, and specification are
Copyright © 1985-2004 Adobe Systems Incorporated.