Skip to content

Instantly share code, notes, and snippets.

@vscarpenter
Created December 4, 2011 01:55
Show Gist options
  • Save vscarpenter/1428839 to your computer and use it in GitHub Desktop.
Save vscarpenter/1428839 to your computer and use it in GitHub Desktop.
import org.apache.pdfbox.util.PDFMergerUtility;
import java.io.File;
public class PDFCombineTest {
public static void main(String[] args) {
PDFMergerUtility mergerUtility = new PDFMergerUtility();
mergerUtility.addSource(new File("C:\\projects\\PDFCombine\\docs\\Getting Started with Vaadin.pdf"));
mergerUtility.addSource(new File("C:\\projects\\PDFCombine\\docs\\Getting Started With Hadoop_0.pdf"));
mergerUtility.addSource(new File("C:\\projects\\PDFCombine\\docs\\Getting Started with Kanban for Software Development.pdf"));
mergerUtility.addSource(new File("C:\\projects\\PDFCombine\\docs\\Getting Started with BIRT.pdf"));
mergerUtility.addSource(new File("C:\\projects\\PDFCombine\\docs\\Getting Started with Git.pdf"));
mergerUtility.addSource(new File("C:\\projects\\PDFCombine\\docs\\Getting Started with NoSQL and Data Scalability.pdf"));
mergerUtility.addSource(new File("C:\\projects\\PDFCombine\\docs\\Getting Started with Apache Hadoop.pdf"));
mergerUtility.addSource(new File("C:\\projects\\PDFCombine\\docs\\getting-started-with-fitnesse.pdf"));
mergerUtility.addSource(new File("C:\\projects\\PDFCombine\\docs\\getting-started-with-git.pdf"));
mergerUtility.setDestinationFileName("output.pdf");
try {
mergerUtility.mergeDocuments();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment