Following blog post uses these examples: Merge Multiple File Types using Java
Last active
June 16, 2021 14:16
-
-
Save GroupDocsGists/bcf021b81840177ce42499faf038e441 to your computer and use it in GitHub Desktop.
Merge two or more difference types of files into one file in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Combine two or more different types of files into one using Java | |
Merger merger = new Merger("pdf_document.pdf"); | |
{ | |
merger.join("word_document.docx"); | |
merger.join("spreadsheet.xlsx"); | |
merger.save("merged-document.pdf"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Combine selective pages of two or more different types of files into one using Java | |
Merger merger = new Merger("pdf_document.pdf"); | |
{ | |
JoinOptions joinOptions = new JoinOptions(new int[]{1}); | |
merger.join("word_document.docx", joinOptions); | |
joinOptions = new JoinOptions(1, 2, RangeMode.EvenPages); | |
merger.join("spreadsheet.xlsx", joinOptions); | |
merger.save("merged-document.pdf"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment