<repositories>
<repository>
<id>repository.groupdocs.com</id>
<name>GroupDocs Repository</name>
<url>https://releases.groupdocs.com/java/repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-merger</artifactId>
<version>24.8</version>
</dependency>
</dependencies>
repositories {
maven {
url 'https://releases.groupdocs.com/java/repo/'
}
}
compile(group: 'com.groupdocs', name: 'groupdocs-merger', version: '24.8')
<ivysettings>
<settings defaultResolver="chain"/>
<resolvers>
<chain name="chain">
<ibiblio name="GroupDocs Repository" m2compatible="true" root="https://releases.groupdocs.com/java/repo/"/>
</chain>
</resolvers>
</ivysettings>
<dependency org="com.groupdocs" name="groupdocs-merger" rev="24.8">
<artifact name="groupdocs-merger" ext="jar"/>
</dependency>
resolvers += Resolver.url("GroupDocs Repository", url("https://releases.groupdocs.com/java/repo/"))
libraryDependencies += "com.groupdocs" % "groupdocs-merger" % "24.8"
High Code Java API to Merge & Join Documents
GroupDocs.Merger for Java on-premise API for merging multiple documents into a single resultant file. Supports joining files of different extensions (formats) into a single format document. OLE object insertions can also be done. You can also change page order, remove desired pages, and split single document into multiple smaller files.
Merge Files
Merge HTML
Merge multiple HTML files into a single document, preserving text, images, tables, and other content.
Merge Images
Combine multiple image formats (JPG, PNG, BMP) into a single document with cross-format merging support.
Merge PDF
Merge multiple PDF files into one, preserving structure, images, and formatting without third-party software.
Merge Word Documents
Combine DOCX, DOC, and RTF files into a single Word document, with options to retain compliance and formatting.
Merge PowerPoint Presentations
Merge PPT, PPTX, and PPSX presentations while maintaining slides, animations, and embedded media.
Merge Excel
Merge Excel spreadsheets (XLS, XLSX) into a single file, preserving data, formulas, and charts.
Merge Text Files
Combine multiple text files (TXT, CSV) into a single document, preserving content structure.
Merge Archives
Merge multiple archive formats (ZIP, RAR) into a single archive or PDF file.
Merge TEX
Merge TEX files into a single document for academic and technical typesetting.
Merge EPUB
Combine EPUB files into a single eBook document.
Merge Open Document Files
Merge OpenDocument files like ODT, ODS, and ODP into a single file while preserving format and content.
Merge Pages from Various Documents
Combine specific pages from different document formats into a single file, offering precise control over page selection.
Merge Documents to DOC
Merge various document formats (PDF, PPT, XLS) into a DOC file for Word processing.
Merge Documents to PDF
Merge different file types (DOC, PPT, XLS) into a single PDF document for universal viewing.
Merge Pages in Arbitrary Order
Merge selected pages from multiple documents in any desired order for custom document creation.
Single Document Operations
Move Page
Allows you to move a specific page to a new position within a document by specifying the current and new page numbers.
Remove Pages
Enables the removal of a single page or multiple pages by specifying page numbers.
Split Document
Splits a document into multiple resultant documents by specifying page numbers or ranges.
Split Text File
Allows splitting a text file into multiple files based on line numbers or other split criteria.
Swap Pages
Enables swapping the positions of two specified pages within a document.
Extract Pages
Provides functionality to extract specific pages from a document into a new file.
Change Page Orientation
Allows changing the orientation (portrait or landscape) of specific or all pages in the document.
Rotate Pages
Enables rotating pages by 90, 180, or 270 degrees.
Generate Document Pages Preview
Allows generating preview images (PNG, JPG, BMP) of the pages of a document.
Import documents
How to add attachment to PDF document
Embeds attachments such as images, PDFs, or other files into a PDF document.
Add document to Word processing via OLE
Embeds documents like PDFs or spreadsheets into Word files via OLE.
Add document to Presentation via OLE
Embeds documents into PowerPoint presentations using OLE technology.
Add document to Spreadsheet via OLE
Embeds documents into Excel spreadsheets using OLE objects.
Add document to Diagram via OLE
Embeds documents into diagrams (such as Visio files) using OLE technology.
Security Operations
Add Document Password
Enables adding a password to documents to secure them from unauthorized access.
Check Document Password Protection
Verifies whether a document is protected by a password and returns a boolean value.
Remove Document Password
Removes the password from a password-protected document.
Update Document Password
Allows updating the existing password for a document, replacing the old one with a new password.
Loading
Load document from InputStream
GroupDocs.Merger allows loading documents directly from an InputStream without saving the document as a file.
Load document from local disk
Load documents from the local disk by specifying the file path using the Merger class.
Load document from URL
Documents can be loaded directly from a URL using an InputStream, enabling processing of remotely located documents.
Load password-protected document
Load documents protected with a password by specifying the password in the LoadOptions object.
Supported Audio Types
Format | Description | Join | Split | Cross-format audio merging |
---|---|---|---|---|
WAV | WAV Audio File | ✔️ |
Supported Document Types
Format | Description | Join | Split | Extract pages | Move page | Remove pages | Swap pages | Change page orientation | Rotate pages | Import document | Cross-format merge to PDF / XPS | Cross-format merge to DOC / DOCX |
---|---|---|---|---|---|---|---|---|---|---|---|---|
DOC | Microsoft Word Document | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
DOCX | Microsoft Word Open XML Document | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
DOCM | Word Open XML Macro-Enabled Document | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
DOT | Word Document Template | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
DOTX | Word Open XML Document Template | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
DOTM | Word Open XML Macro-Enabled Document Template | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
RTF | Rich Text Format File | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ||
ODT | OpenDocument Text Document | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
OTT | OpenDocument Document Template | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
HTML | Hypertext Markup Language File | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |||
MHT | MHTML Web Archive | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ||||
MHTML | MIME HTML | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ||||
Portable Document Format File | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
XPS | XML Paper Specification File | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |||
TEX | LaTeX Source Document | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |||
EPUB | Open eBook File | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |||
PS | PostScript File | ✔️ | ||||||||||
PPT | Microsoft PowerPoint 97-2003 Presentation | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
PPTX | Microsoft PowerPoint Presentation | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
PPS | Microsoft PowerPoint 97-2003 Slide Show | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
PPSX | Microsoft PowerPoint Slide Show | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
PPTM | Microsoft PowerPoint Macro-Enabled Presentation | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
ODP | OpenDocument Presentation | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ||
OTP | OpenDocument Presentation Template | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ||
XLS | Microsoft Excel 97-2003 Worksheet | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
XLSX | Microsoft Excel Worksheet | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
XLSB | Microsoft Excel Binary Worksheet | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
XLSM | Microsoft Excel Macro-Enabled Worksheet | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
XLT | Microsoft Excel Template File | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
XLTX | Excel Open XML Spreadsheet Template | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
XLTM | Excel Open XML Macro-Enabled Spreadsheet Template | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
XLAM | Excel Open XML Macro-Enabled Add-in | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
ODS | OpenDocument Spreadsheet | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ||
VSDX | Microsoft Visio Drawing | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |||
VSDM | Microsoft Visio Macro-Enabled Drawing | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |||
VSSX | Microsoft Visio Stencil | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |||
VSSM | Microsoft Visio Macro-Enabled Stencil | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |||
VSTX | Microsoft Visio Template | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |||
VSTM | Microsoft Visio Macro-Enabled Template | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |||
VDX | Microsoft Visio 2003-2010 XML Drawing | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |||
VSX | Microsoft Visio 2003-2010 XML Stencil | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |||
VTX | Microsoft Visio 2003-2010 XML Template | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |||
ONE | Microsoft OneNote | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |||
TXT | Plain Text File | ✔️ | ✔️ | |||||||||
ERR | Error Log File | ✔️ | ✔️ | |||||||||
CSV | Comma Separated Values File | ✔️ | ✔️ | |||||||||
TSV | Tab Separated Values File | ✔️ | ✔️ |
Supported Archive Types
Format | Description | Join | Split | Cross-format archive merging |
---|---|---|---|---|
ZIP | ZIP Archive File | ✔️ | ✔️ | |
TAR | TAR Archive File | ✔️ | ✔️ | |
7Z | 7Z Archive File | ✔️ | ✔️ |
Supported Image Types
Format | Description | Join | Split | Extract pages | Cross-format image merging | Cross-format merge to PDF |
---|---|---|---|---|---|---|
JPG | JPG Image File | ✔️ | ✔️ | ✔️ | ||
JPEG | JPEG Image File | ✔️ | ✔️ | ✔️ | ||
BMP | Bitmap Image File | ✔️ | ✔️ | ✔️ | ||
PNG | Portable Network Graphics | ✔️ | ✔️ | ✔️ | ||
GIF | Graphical Interchange Format | ✔️ | ✔️ | ✔️ | ||
TIF | Tagged Image Format | ✔️ | ✔️ | ✔️ | ✔️ | |
TIFF | Tagged Image File Format | ✔️ | ✔️ | ✔️ | ✔️ | |
SVG | Scalar Vector Graphics | ✔️ | ✔️ | ✔️ | ||
SVGZ | Compressed Scalar Vector Graphics | ✔️ | ✔️ | ✔️ | ||
EMF | Windows Enhanced Metafile | ✔️ | ||||
EMZ | Windows Compressed Enhanced Metafile | ✔️ |
Supported Operating Systems
Windows
Windows 2003/2008/2012/2016/2019 Server (x64, x86)
Windows Vista, XP, 7, 8, 8.1, 10 (x64, x86)
Microsoft Azure
Linux
Ubuntu, OpenSUSE, CentOS, and others
Mac
macOS
Supported Java Versions
J2SE 8.0 (1.8) or higher (e.g., Java 10)
Supported Runtime
Java version 8+ (Kotlin supported)
Development Environments
NetBeans, IntelliJ IDEA, Eclipse
Installation from GroupDocs Repository
Java packages are hosted on the GroupDocs Artifact Repository. To add GroupDocs.Merger to your project:
1. Add GroupDocs Repository
<repositories>
<repository>
<id>repository.groupdocs.com</id>
<name>GroupDocs Repository</name>
<url>https://releases.groupdocs.com/java/repo/</url>
</repository>
</repositories>
2. Add GroupDocs.Merger Dependency
<dependencies>
<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-merger</artifactId>
<version>24.8</version>
</dependency>
</dependencies>
Sample Java code to Join two Word® DOCX
documents into one
String filePath = "c:\sample.docx";
String filePath2 = "c:\sample2.docx";
String filePathOut = "c:\output\result.docx";
JoinOptions joinOptions = new JoinOptions(1, 2);
Merger merger = new Merger(filePath);
merger.join(filePath2 , joinOptions);
merger.save(filePathOut);
Version | Release Date |
---|---|
24.8 | August 19, 2024 |
24.6 | June 20, 2024 |
24.2 | February 20, 2024 |
23.10 | October 9, 2023 |
23.8 | August 1, 2023 |
23.2 | February 23, 2023 |
22.12 | December 12, 2022 |
22.7 | July 14, 2022 |
22.2 | February 16, 2022 |
21.9 | January 25, 2022 |
20.7 | January 25, 2022 |
19.2.1 | January 25, 2022 |
21.7 | July 1, 2021 |
21.3 | March 26, 2021 |
20.11 | November 9, 2020 |
20.4 | April 7, 2020 |
19.12 | December 24, 2019 |
19.8 | August 14, 2019 |
19.6 | June 14, 2019 |
19.2 | February 26, 2019 |
18.12 | December 24, 2018 |
18.8 | August 14, 2018 |
GroupDocs.Total GroupDocs.Merger API on premise DOC DOCX DOCM DOT DOTX DOTM RTF ODT OTT XLS XLSX XLSB XLSM XLT XLTX XLTM XLAM ODS PPT PPTX PPS PPSX ODP OTP VSDX VSDM VSSX VSSM VSTX VSTM VDX VSX VTX ONE HTML MHT MHTML PDF XPS TEX EPUB TXT ERR CSV TSV windows macOS Linux J2SE azure document automation merge merger merging join append joiner combine content formatting page setup OLE password protection split spliter spliting swap rotate