public class MergeUtil extends 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(String[] args)
Deprecated.
Command-line usage of this class may be moved or removed in future PDFxStream releases.
|
static void |
mergeDocuments(File[] pdfFiles,
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(File[] pdfFiles,
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(File[] pdfFiles, File destFile)
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 writtenIOException
- thrown if an error occurs while merging the given list of PDF filesMergeUtil.mergeDocuments(File[], OutputStream)
public static void mergeDocuments(File[] pdfFiles, OutputStream destStream)
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 writtenIOException
- thrown if an error occurs while merging the given list of PDF filespublic static void main(String[] args)
Command-line interface to PDF merge functionality.
Usage:
java -cp PDFxStream.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 PDFxStream.jar com.snowtide.pdf.util.MergeUtil ~/folder/report1.pdf ~/index.pdf result.pdf