|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.faceless.pdf2.PDFReader
The PDFReader
class adds the ability to load an existing PDF to the
library. Note that this class is part of the "Extended Edition" of the
library - although it's supplied with the package an "extended edition"
license must be purchased to activate this class.
There are almost no public methods in this class - the only use for a
PDFReader
object is as a parameter the appropriate PDF.PDF(PDFReader)
constructor.
The one exception to this is the getNumberOfRevisions()
method, added
in release 1.2.1. In order to explain this method it's necessary to go into
a little detail about the file structure of a PDF document.
A PDF file may sometimes contain different versions of itself in the one file. These "revisions" show how the state of the document has changed over time. For most purposes this information isn't terribly useful - prior to version 1.2.1 only the latest revision was used - but they do play an important role when using Digital Signatures.
When a signature is applied to the file, the current revision is locked and any further changes to the file result in a new revision being made. With Adobe Acrobat several signatures can be applied, each one of which will result in a new revision.
It's important to remember that changes can be made a document after it's been signed, and provided that they're made in a new revision, the signature won't be invalidated - but the signature won't cover the whole of the document either. When validating a signed document this needs to be taken into account
Another interesting feature of revisions is that with a document with multiple
revisions, it's possible to "roll back" to a previous version. This is done by
passing in a specific revision number to the PDF.PDF(PDFReader,int)
constructor - the PDF will be created as it was at the specified revision.
Finally, although a PDF document containing multiple revisions can be read, when it's written out it will be "flattened" into a single revision.
Constructor Summary | |
PDFReader(File in)
Read an unencrypted PDF from the specified file. |
|
PDFReader(File in,
EncryptionHandler encrypt)
Read an encrypted PDF from the specified File. |
|
PDFReader(File in,
String password)
Read an encrypted PDF from the specified File. |
|
PDFReader(InputStream in)
Read an encrypted PDF from the specified InputStream. |
|
PDFReader(InputStream in,
EncryptionHandler encrypt)
Read an encrypted PDF from the specified InputStream. |
|
PDFReader(InputStream in,
String password)
Read an encrypted PDF from the specified InputStream. |
Method Summary | |
void |
finalize()
|
int |
getNumberOfRevisions()
Return the number of revisions that have been made to this file. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PDFReader(File in) throws IOException
PDFReader(InputStream)
constructor, but takes slightly longer to run.
in
- the File to read frompublic PDFReader(File in, String password) throws IOException
StandardEncryptionHandler
and the specified password.
This constructor is identical to calling
new PDFReader(in, new StandardEncryptionHandler(password))
,
and it requires less memory than than the PDFReader(InputStream,String)
constructor, but takes slightly longer to run.
in
- the File to read frompassword
- the password needed to open the filepublic PDFReader(InputStream in) throws IOException
in
- the stream to read frompublic PDFReader(InputStream in, String password) throws IOException
StandardEncryptionHandler
and the specified password. This method
is identical to calling new PDFReader(in, new StandardEncryptionHandler(password))
.
Please note the InputStream is not closed by this method, but should be closed by the user
in
- the stream to read frompassword
- the password needed to open the filepublic PDFReader(InputStream in, EncryptionHandler encrypt) throws IOException
EncryptionHandler
to
be used to read the document.
Please note the InputStream is not closed by this method, but should be closed by the user
in
- the stream to read fromencrypt
- the EncryptioHandler to use to decrypt the documentpublic PDFReader(File in, EncryptionHandler encrypt) throws IOException
EncryptionHandler
to be used to read the document.
It also uses less memory than the PDFReader(File, EncryptionHandler)
constructor.
in
- the stream to read fromencrypt
- the EncryptioHandler to use to decrypt the documentMethod Detail |
public int getNumberOfRevisions()
PDF.PDF(PDFReader,int)
constructor.
public void finalize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |