Created
June 17, 2021 10:25
-
-
Save conholdate-gists/9d404af999079633a15bc719fca77557 to your computer and use it in GitHub Desktop.
Merge Word Documents using 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
Merge Word Documents using Java | |
1. Java API for Merging Word Documents | |
2. Merge Word Documents using Java | |
3. Combine Specific Pages of Word Documents using Java | |
4. Merge and Secure with Password using Java | |
5. Merge Word Document into PDF using 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
// Initialize API | |
Merger merger = new Merger("C:\\Files\\merger\\sample.docx"); | |
// Define join options | |
JoinOptions joinOptions = new JoinOptions(1, 2); | |
// Merge | |
merger.join("C:\\Files\\merger\\sample2.docx", joinOptions); | |
// Save the merged file | |
merger.save("C:\\Files\\merger\\output.docx"); |
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
// Initialize API | |
Merger merger = new Merger("C:\\Files\\sample.docx"); | |
// Merge files | |
merger.join("C:\\Files\\sample2.docx"); | |
merger.join("C:\\Files\\sample3.docx"); | |
// Set Password | |
AddPasswordOptions addOptions = new AddPasswordOptions("password"); | |
merger.addPassword(addOptions); | |
// Save the merged file | |
merger.save("C:\\Files\\output.docx"); |
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
// Initialize API | |
Merger merger = new Merger("C:\\Files\\sample.docx"); | |
// Merge files | |
merger.join("C:\\Files\\sample2.docx"); | |
merger.join("C:\\Files\\sample3.docx"); | |
// Save the merged file | |
merger.save("C:\\Files\\output.docx"); |
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
// Initialize API | |
Merger merger = new Merger("C:\\Files\\sample.pdf"); | |
// Merge files | |
merger.join("C:\\Files\\sample.docx"); | |
// Save the merged file | |
merger.save("C:\\Files\\output.pdf"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment