public class PDFMergerUtility extends Object
Constructor and Description |
---|
PDFMergerUtility()
Instantiate a new PDFMergerUtility.
|
Modifier and Type | Method and Description |
---|---|
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()
Deprecated.
|
void |
mergeDocuments(MemoryUsageSetting memUsageSetting)
Merge the list of source documents, 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.
|
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) throws FileNotFoundException
source
- Full path and file name of source document.FileNotFoundException
- If the file doesn't existpublic void addSource(File source) throws FileNotFoundException
source
- File representing source documentFileNotFoundException
- If the file doesn't existpublic void addSource(InputStream source)
source
- InputStream representing source documentpublic void addSources(List<InputStream> sourcesList)
sourcesList
- List of InputStream objects representing source
documents@Deprecated public void mergeDocuments() throws IOException
mergeDocuments(org.apache.pdfbox.io.MemoryUsageSetting)
IOException
- If there is an error saving the document.public void mergeDocuments(MemoryUsageSetting memUsageSetting) throws IOException
memUsageSetting
- defines how memory is used for buffering PDF streams;
in case of null
unrestricted main memory is usedIOException
- If there is an error saving the document.public void appendDocument(PDDocument destination, PDDocument source) throws IOException
destination
- the document to receive the pagessource
- the document originating the new pagesIOException
- 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
ignoredCopyright © 2002–2016 The Apache Software Foundation. All rights reserved.