Split the presentation into multiple single page presentations.
#PDF MERGE JAVA PDF#
The following code will split a PDF file into 3 documents, each having the mentioned single page. We can split a document by providing the exact number of pages in Java. Split a document to several multi-page documents.Just like we have merged documents above, we can also split Word documents, Excel spreadsheets, presentations, PDF files, and many other documents quickly in different ways. Split Documents into Multiple Documents in Java # Merger.join("document-2.docx", joinOptions) Merger merger = new Merger("document-1.docx") Merge two files with selective pages using join method. JoinOptions joinOptions = new JoinOptions(1, 2) Set the start and end page number in JoinOptions class.
#PDF MERGE JAVA HOW TO#
Your code will remain similar to the mentioned above, just a little change while setting your merging options using JoinOptions class.īelow is the source code snippet that shows how to merge documents by specifying certain pages. Multiple documents can be merged by selective pages and also by specifying the desired page range. Merger.join("document3.docx" ) // Joining 3rd Document Merger.join("document2.docx" ) // Joining 2nd Document Merger merger = new Merger("document1.docx" ) Merger multiple Word documents into a single DOCX file. Here for an example, I am showing how similarly, more than two Word documents can be combined together into a single Word file in just a few lines of Java code. At the bottom of the article, I will mention the list of file formats that can be merged with the same code. The above code of joining PDF documents can be used to merge a wide variety of documents. You can combine multiple Word documents, Excel Spreadsheets, PowerPoint presentations, in fact, almost any documents of the same format. Merge Excel, Word, PowerPoint Documents in Java # String filePathOutput = "mergedDocument.pdf" Merger.join(filePath3 ) // Joining 3rd Document Merger.join(filePath2 ) // Joining 2nd Document Merger multiple PDF documents into a single PDF file. Set paths for the documents to join together in a single file.
#PDF MERGE JAVA DOWNLOAD#
The code sample and steps explained below are using GroupDocs.Merger for Java so you may download or integrate it into your maven-based applications with pom.xml configurations.