com.sun.pdfview
public class PDFFile extends Object
Constructor Summary | |
---|---|
PDFFile(ByteBuffer buf)
get a PDFFile from a .pdf file. |
Method Summary | |
---|---|
PDFObject | dereference(PDFXref ref)
Used internally to track down PDFObject references. |
int | getMajorVersion()
return the major version of the PDF
|
int | getMinorVersion()
return the minor version of the PDF
|
int | getNumPages()
return the number of pages in this PDFFile. |
OutlineNode | getOutline()
Gets the outline tree as a tree of OutlineNode, which is a subclass
of DefaultMutableTreeNode. |
PDFPage | getPage(int pagenum)
Get the page commands for a given page in a separate thread.
|
PDFPage | getPage(int pagenum, boolean wait)
Get the page commands for a given page.
|
int | getPageNumber(PDFObject page)
Gets the page number (starting from 1) of the page represented by
a particular PDFObject. |
PDFObject | getRoot()
get the root PDFObject of this PDFFile. |
String | getVersionString()
return the version string from the PDF
|
static boolean | isDelimiter(int c)
Is the argument a delimiter according to the PDF spec? |
boolean | isPrintable()
Gets whether the owner of the file has given permission to print
the file. |
boolean | isSaveable()
Gets whether the owner of the file has given permission to save
a copy of the file. |
static boolean | isWhiteSpace(int c)
Is the argument a white space character according to the PDF spec? |
Float | parseRect(PDFObject obj)
get a Rectangle2D.Float representation for a PDFObject that is an
array of four Numbers. |
void | stop(int pageNum)
Stop the rendering of a particular image on this page |
Use the getPage(...) methods to get a page from the PDF file.
Parameters: buf the RandomAccessFile containing the PDF.
Since this is the only public method for tracking down PDF objects, it is synchronized. This means that the PDFFile can only hunt down one object at a time, preventing the file's location from getting messed around.
This call stores the current buffer position before any changes are made and restores it afterwards, so callers need not know that the position has changed.
Returns:
Returns:
Parameters: pagenum the number of the page to get commands for
Parameters: pagenum the number of the page to get commands for wait if true, do not exit until the page is complete.
Returns: a number between 1 and the number of pages indicating the page number, or 0 if the PDFObject is not in the page tree.
Returns:
Returns: true if it is okay to print the file
Returns: true if it is okay to save the file
Parameters: obj a PDFObject that represents an Array of exactly four Numbers.