|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pdfbox.util.PDFMergerUtility
public class PDFMergerUtility
This class will take a list of pdf documents and merge them, saving the result in a new document.
Constructor Summary | |
---|---|
PDFMergerUtility()
Instantiate a new PDFMergerUtility. |
Method Summary | |
---|---|
void |
addSource(java.io.File source)
Add a source file to the list of files to mere. |
void |
addSource(java.lang.String source)
Add a source file to the list of files to merge. |
void |
appendDocument(PDDocument destination,
PDDocument source)
append all pages from source to destination. |
java.lang.String |
getDestinationFileName()
Get the name of the destination file. |
void |
mergeDocuments()
Merge the list of source documents, saving the result in the destination file. |
void |
setDestinationFileName(java.lang.String destination)
Set the name of the destination file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PDFMergerUtility()
Method Detail |
---|
public java.lang.String getDestinationFileName()
public void setDestinationFileName(java.lang.String destination)
destination
- The destination to set.public void addSource(java.lang.String source)
source
- Full path and file name of source document.public void addSource(java.io.File source)
source
- File representing source documentpublic void mergeDocuments() throws java.io.IOException, COSVisitorException
java.io.IOException
- If there is an error saving the document.
COSVisitorException
- If an error occurs while saving the destination file.public void appendDocument(PDDocument destination, PDDocument source) throws java.io.IOException
destination
- the document to receive the pagessource
- the document originating the new pages
java.io.IOException
- If there is an error accessing data from either document.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |