|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.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(File source)
Add a source file to the list of files to merge. |
void |
addSource(InputStream source)
Add a source to the list of documents to merge. |
void |
addSource(String source)
Add a source file to the list of files to merge. |
void |
addSources(List<InputStream> sourcesList)
Add a list of sources to the list of documents to merge. |
void |
appendDocument(PDDocument destination,
PDDocument source)
append all pages from source to destination. |
String |
getDestinationFileName()
Get the name of the destination file. |
OutputStream |
getDestinationStream()
Get the destination OutputStream. |
boolean |
isIgnoreAcroFormErrors()
Indicates if acroform errors are ignored or not. |
void |
mergeDocuments()
Merge the list of source documents, saving the result in the destination file. |
void |
mergeDocumentsNonSeq(RandomAccess scratchFile)
Merge the list of source documents with the non sequential parser, saving the result in the destination file. |
void |
setDestinationFileName(String destination)
Set the name of the destination file. |
void |
setDestinationStream(OutputStream destStream)
Set the destination OutputStream. |
void |
setIgnoreAcroFormErrors(boolean ignoreAcroFormErrorsValue)
Set to true to ignore acroform errors. |
| 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 String getDestinationFileName()
public void setDestinationFileName(String destination)
destination - The destination to set.public OutputStream getDestinationStream()
public void setDestinationStream(OutputStream destStream)
destStream - The destination to set.public void addSource(String source)
source - Full path and file name of source document.public void addSource(File source)
source - File representing source documentpublic void addSource(InputStream source)
source - InputStream representing source documentpublic void addSources(List<InputStream> sourcesList)
sourcesList - List of InputStream objects representing source
documents
public void mergeDocuments()
throws IOException,
COSVisitorException
IOException - If there is an error saving the document.
COSVisitorException - If an error occurs while saving the
destination file.
public void mergeDocumentsNonSeq(RandomAccess scratchFile)
throws IOException,
COSVisitorException
scratchFile - location to store temp PDFBox data for this output
document, can be null if temp data is to be stored in memory
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 IOException
destination - the document to receive the pagessource - the document originating the new pages
IOException - If there is an error accessing data from either
document.public boolean isIgnoreAcroFormErrors()
public void setIgnoreAcroFormErrors(boolean ignoreAcroFormErrorsValue)
ignoreAcroFormErrorsValue - true if acroform errors should be
ignored
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||