In this article, I will introduce two methods to merge PDF files in Java application. 1. Merge PDF files into a single file 2. Merge a specific page or a page range of a PDF file into another PDF file The below examples use Free Spire.PDF for Java library. Imported NameSpace: import com.spire.pdf.PdfDocument; import com.spire.pdf.PdfDocumentBase; Merge PDF files into a single file String[] files = new String[] { "file1.pdf" , "file2.pdf" }; //load PDF files PdfDocumentBase pdf = PdfDocument. mergeFiles (files); //merge into a single file pdf.save( "MergeFiles.pdf" ); Merge a specific page or a page range of a PDF file into another PDF file String[] files = new String[] { "file1.pdf" , "file2.pdf" , ...
A blog about Microsoft Office and PDF document development using .NET and Java.