|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.crionics.jpdf.PdfDocument
public class PdfDocument
Main jPDF class.
WARNING: DEPENDING ON YOUR LICENSE NOT ALL THESE FEATURES MAY BE
ACTIVATED. The class contains all the mandatory methods to manipulate
programmaticaly a pdf document. jPDF uses a per-file cache to optimize PDF
parsing. The cache entries are purged by the JVM when it requires memory. You
can force the cache cleanup by calling the close() method on the document or
the method purgeCache(). Be very careful: if another process is updating the
PDF file, you may find document/cache out of sync problems. Clear the cache
wisely.
| Field Summary | |
|---|---|
PdfDoc |
document
|
| Constructor Summary | |
|---|---|
PdfDocument()
Creates a new PdfDocument in memory. |
|
PdfDocument(byte[] buffer)
Opens a the given document from a memory array Note: When using this constructor the whole document will be held in memory. |
|
PdfDocument(byte[] buffer,
ICredentials credentials)
|
|
PdfDocument(byte[] buffer,
Preferences prefs)
Opens a the given document from a memory array Note: When using this constructor the whole document will be held in memory. |
|
PdfDocument(ByteReader reader)
Opens the given PDF document. |
|
PdfDocument(ByteReader reader,
ICredentials credentials)
Opens the document from the specified reader using the given reader and credentials. |
|
PdfDocument(ByteReader reader,
Preferences prefs)
PdfDocument constructor. which takes a ByteReader and the default pdf preferences to use during the generation. |
|
PdfDocument(java.io.File file)
Opens the given PDF document. |
|
PdfDocument(java.io.File file,
ICredentials credentials)
|
|
PdfDocument(java.io.File file,
Preferences prefs)
Opens the given file using the given generation preferences. |
|
PdfDocument(Preferences preferences)
Creates a new PdfDocument object using the given PDF generation preferences. |
|
PdfDocument(java.lang.String filename)
PdfDocument constructor which takes a pdf filename as an argument. |
|
PdfDocument(java.lang.String filename,
ICredentials credentials)
Opens the given document uctor which takes a ByteReader and the User or Owner password as arguments. |
|
PdfDocument(java.lang.String filename,
Preferences prefs)
PdfDocument constructor which takes a pdf filename and the User or Owner password as arguments. |
|
| Method Summary | |
|---|---|
void |
addOpenAction(AbstractAction action)
Sets the action to perform when the document is opened. |
void |
clearOpenAction()
Clears the list of actions to perform when the document is opened |
void |
close()
Frees up all resources associated with the document Cleans up internal structures and cache entries for this document. |
AbstractAction |
getBeforeClosingDocumentActions()
Returns the actions performed when the document is closed |
CreatorModule |
getCreatorModule()
Return the the Creator Module. |
PdfDocumentDescription |
getDescription()
Returns information about the document |
EncryptionModule |
getEncryptionModule()
Return the the Encryption Module. |
MergerModule |
getMergerModule()
Return the the Merger Module. |
AbstractAction |
getOnBeforeDocumentOpenAction()
Returns the actions performed when the document is opened |
int |
getPageCount()
Returns the number of pages in the document |
Preferences |
getPreferences()
Returns the preferences for this document. |
PrinterModule |
getPrinterModule()
Return the the Printer Module. |
PdfDocumentSecurity |
getSecurity()
Returns the security handler which can be used to check access permissions to the document content |
SignerModule |
getSignerModule()
Return the the Signer Module. |
TemplateModule |
getTemplateModule()
Return the the Template Module. |
boolean |
isUpdated()
Returns true if data (due to document modifications) were appended to the document |
void |
purgeCache()
Purges the document cache. |
void |
save()
Incrementally updates the document. extremely fast as it only appends the changes. |
void |
saveAs(java.io.File fileDest)
Incrementally saves the document to a new destination. |
void |
saveAs(java.lang.String fileDest)
Incrementally saves the document to a new destination. |
void |
saveAsNew(java.io.File fileDest)
Saves the document as a new document. |
void |
saveAsNew(java.lang.String fileDest)
Saves the document as a new document. optimizes the pdf to remove unused incremental updates (if any). |
void |
saveCopy(java.io.File file)
Saves the current document along all the updates to a new location. |
void |
saveCopy(java.io.OutputStream os)
Saves the current document along all the updates to a new location. |
void |
saveCopy(java.lang.String filename)
Saves the updated document to a new location. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public PdfDoc document
| Constructor Detail |
|---|
public PdfDocument()
throws java.io.IOException,
PdfException
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public PdfDocument(byte[] buffer)
throws java.io.IOException,
PdfException
buffer - The byte array containing the document.
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public PdfDocument(byte[] buffer,
ICredentials credentials)
throws java.io.IOException,
PdfException
java.io.IOException
PdfException
public PdfDocument(byte[] buffer,
Preferences prefs)
throws java.io.IOException,
PdfException
buffer - The byte array containing the document.prefs - the preferences used to generate the document
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public PdfDocument(ByteReader reader)
throws java.io.IOException,
PdfException
reader - The bytereader.
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public PdfDocument(ByteReader reader,
ICredentials credentials)
throws java.io.IOException,
PdfException
reader - a bytereader representing the PDF documentcredentials - a password or a certificate.
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public PdfDocument(ByteReader reader,
Preferences prefs)
throws java.io.IOException,
PdfException
reader - The bytereader.prefs - the preferences used to generate the document
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public PdfDocument(java.io.File file)
throws java.io.IOException,
PdfException
file - The PDF File to open.
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public PdfDocument(java.io.File file,
ICredentials credentials)
throws java.io.IOException,
PdfException
java.io.IOException
PdfException
public PdfDocument(java.io.File file,
Preferences prefs)
throws java.io.IOException,
PdfException
file - The PDF File to open.prefs - the preferences used to generate the document
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public PdfDocument(Preferences preferences)
throws java.io.IOException,
PdfException
preferences - the preferences used to generate the document
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public PdfDocument(java.lang.String filename)
throws java.io.IOException,
PdfException
filename - The PDF file to open.
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public PdfDocument(java.lang.String filename,
ICredentials credentials)
throws java.io.IOException,
PdfException
reader - The bytereader.prefs - the preferences used to generate the document
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public PdfDocument(java.lang.String filename,
Preferences prefs)
throws java.io.IOException,
PdfException
filename - The PDF Filename.prefs - the preferences used to generate the document
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.| Method Detail |
|---|
public void addOpenAction(AbstractAction action)
throws java.io.IOException,
PdfException
action - -
the action to perform when the document is opened
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public void clearOpenAction()
throws java.io.IOException,
PdfException
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public void close()
throws java.io.IOException
java.io.IOException - Raised if a problem occured while reading the file.
public AbstractAction getBeforeClosingDocumentActions()
throws java.io.IOException,
PdfException
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.public CreatorModule getCreatorModule()
public PdfDocumentDescription getDescription()
public EncryptionModule getEncryptionModule()
public MergerModule getMergerModule()
public AbstractAction getOnBeforeDocumentOpenAction()
throws java.io.IOException,
PdfException
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.public int getPageCount()
public Preferences getPreferences()
public PrinterModule getPrinterModule()
public PdfDocumentSecurity getSecurity()
public SignerModule getSignerModule()
public TemplateModule getTemplateModule()
public boolean isUpdated()
public void purgeCache()
public void save()
throws java.io.IOException,
PdfException
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public void saveAs(java.io.File fileDest)
throws java.io.IOException,
PdfException
fileDest - The new destination of the document.
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public void saveAs(java.lang.String fileDest)
throws java.io.IOException,
PdfException
fileDest - The new destination of the document.
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public void saveAsNew(java.io.File fileDest)
throws java.io.IOException,
PdfException
fileDest - The new destination of the document.
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public void saveAsNew(java.lang.String fileDest)
throws java.io.IOException,
PdfException
fileDest - The new destination of the document.
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public void saveCopy(java.io.File file)
throws java.io.IOException,
PdfException
file - Destination File Object.
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public void saveCopy(java.io.OutputStream os)
throws java.io.IOException,
PdfException
os - Destination output stream.
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public void saveCopy(java.lang.String filename)
throws java.io.IOException,
PdfException
filename - Destination file name.
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||