org.pdfbox.util
Class PDFMergerUtility
java.lang.Object
org.pdfbox.util.PDFMergerUtility
public class PDFMergerUtility
extends java.lang.Object
This class will take a list of pdf documents and merge them, saving the result
in a new document.
PDFMergerUtility
public PDFMergerUtility()
Instantiate a new PDFMergerUtility.
addSource
public void addSource(File source)
Add a source file to the list of files to mere.
source
- File representing source document
addSource
public void addSource(String source)
Add a source file to the list of files to merge.
source
- Full path and file name of source document.
appendDocument
public void appendDocument(PDDocument destination,
PDDocument source)
throws IOException
append all pages from source to destination.
destination
- the document to receive the pagessource
- the document originating the new pages
getDestinationFileName
public String getDestinationFileName()
Get the name of the destination file.
mergeDocuments
public void mergeDocuments()
throws IOException,
COSVisitorException
Merge the list of source documents, saving the result in the destination file.
setDestinationFileName
public void setDestinationFileName(String destination)
Set the name of the destination file.
destination
- The destination to set.