PJX

com.etymon.pjx
Class PdfReader

java.lang.Object
  extended bycom.etymon.pjx.PdfReader

public final class PdfReader
extends java.lang.Object

Reads a PDF document. Most applications do not need to access methods in this class but should instead go through PdfManager. This class is synchronized.


Constructor Summary
PdfReader(PdfInput pdfInput)
          Creates a reader for a PDF document to be read from a PdfInput source.
 
Method Summary
 void close()
          Closes the PDF document and releases any system resources associated with it.
 PdfInput getInput()
          Returns the PdfInput instance associated with this document.
 java.lang.String readHeader()
          Reads the header of the PDF document.
 PdfObject readObject(long start, long end, boolean indirect, XrefTable xt)
          Reads a PDF object from the document.
 long readStartxref()
          Reads the startxref value from the PDF document.
 XrefTable readXrefTable(long startxref)
          Reads and compiles all cross-reference tables and trailer dictionaries from the PDF document beginning at a specified position.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PdfReader

public PdfReader(PdfInput pdfInput)
Creates a reader for a PDF document to be read from a PdfInput source.

Parameters:
pdfInput - the source to read the PDF document from.
Method Detail

getInput

public PdfInput getInput()
Returns the PdfInput instance associated with this document.


close

public void close()
           throws java.io.IOException
Closes the PDF document and releases any system resources associated with it.

Throws:
java.io.IOException

readHeader

public java.lang.String readHeader()
                            throws java.io.IOException,
                                   PdfException
Reads the header of the PDF document.

Returns:
the PDF document header.
Throws:
java.io.IOException
PdfException

readObject

public PdfObject readObject(long start,
                            long end,
                            boolean indirect,
                            XrefTable xt)
                     throws java.io.IOException,
                            PdfFormatException
Reads a PDF object from the document. The object is filtered through PdfReaderFilter. It is possible for this method to return null if the filtering method discards all objects.

Parameters:
start - the offset where the object starts.
end - the offset where the object ends.
indirect - true if the object is preceded by the object number, generation, and "obj".
xt - the PDF document's cross-reference table.
Returns:
the PDF object.
Throws:
java.io.IOException
PdfFormatException

readStartxref

public long readStartxref()
                   throws java.io.IOException,
                          PdfFormatException
Reads the startxref value from the PDF document.

Returns:
the startxref value.
Throws:
java.io.IOException
PdfFormatException

readXrefTable

public XrefTable readXrefTable(long startxref)
                        throws java.io.IOException,
                               PdfFormatException
Reads and compiles all cross-reference tables and trailer dictionaries from the PDF document beginning at a specified position. The most recent trailer dictionary is filtered through PdfReaderFilter.

Parameters:
startxref - the xref start position.
Returns:
the cross-reference table and trailer.
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.