public class MergeUtil
extends java.lang.Object
A PDF file merge utility.
This utility supports merging any number of PDF files into a single PDF document. Metadata, annotations, bookmarks, and form data that might be found in the given source PDF files are not transferred to the merged PDF file.
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Deprecated.
Command-line interface to PDF merge functionality.
|
static void |
mergeDocuments(java.io.File[] pdfFiles,
java.io.File destFile)
Deprecated.
Merges a series of PDF files into a single PDF document, and writes the merged document data to the given file path.
|
static void |
mergeDocuments(java.io.File[] pdfFiles,
java.io.OutputStream destStream)
Deprecated.
Merges a series of PDF files into a single PDF document, and writes the merged document data to the given OutputStream.
|
public static void mergeDocuments(java.io.File[] pdfFiles, java.io.File destFile) throws java.io.IOException
pdfFiles
- - an array of File references to the PDF files to be merged, in the order their content should appear in
the resulting merged PDF documentdestFile
- - a File reference where the merged PDF document is writtenjava.io.IOException
- - thrown if an error occurs while merging the given list of PDF filesmergeDocuments(File[], OutputStream)
public static void mergeDocuments(java.io.File[] pdfFiles, java.io.OutputStream destStream) throws java.io.IOException
pdfFiles
- - an array of File references to the PDF files to be merged, in the order their content should appear in
the resulting merged PDF documentdestStream
- - an OutputStream to which the merged PDF document data is writtenjava.io.IOException
- - thrown if an error occurs while merging the given list of PDF filespublic static void main(java.lang.String[] args)
Command-line interface to PDF merge functionality.
Usage:
java -cp PDFTextStream.jar com.snowtide.pdf.util.MergeUtil [src_pdf1] [src_pdf2] ... [src_pdfN] [dest_path]
Any number of paths to source PDF documents may be passed as arguments to this utility; the last argument provided is assumed to be the desired destination path of the merged PDF file
Example:
java -cp PDFTextStream.jar com.snowtide.pdf.util.MergeUtil ~/folder/report1.pdf ~/index.pdf result.pdf