|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.pdfview.PDFFile
public class PDFFile
An encapsulation of a .pdf file. The methods of this class can parse the contents of a PDF file, but those methods are hidden. Instead, the public methods of this class allow access to the pages in the PDF file. Typically, you create a new PDFFile, ask it for the number of pages, and then request one or more PDFPages.
Constructor Summary | |
---|---|
PDFFile(java.nio.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. |
java.lang.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? |
java.awt.geom.Rectangle2D.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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PDFFile(java.nio.ByteBuffer buf) throws java.io.IOException
Use the getPage(...) methods to get a page from the PDF file.
buf
- the RandomAccessFile containing the PDF.
java.io.IOException
Method Detail |
---|
public boolean isPrintable()
public boolean isSaveable()
public PDFObject getRoot()
public int getNumPages()
public PDFObject dereference(PDFXref ref) throws java.io.IOException
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.
java.io.IOException
public static boolean isWhiteSpace(int c)
public static boolean isDelimiter(int c)
public int getMajorVersion()
public int getMinorVersion()
public java.lang.String getVersionString()
public OutlineNode getOutline() throws java.io.IOException
java.io.IOException
public int getPageNumber(PDFObject page) throws java.io.IOException
java.io.IOException
public PDFPage getPage(int pagenum)
pagenum
- the number of the page to get commands forpublic PDFPage getPage(int pagenum, boolean wait)
pagenum
- the number of the page to get commands forwait
- if true, do not exit until the page is complete.public void stop(int pageNum)
public java.awt.geom.Rectangle2D.Float parseRect(PDFObject obj) throws java.io.IOException
obj
- a PDFObject that represents an Array of exactly four
Numbers.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |