GroupDocs.Merger at a glance

API to combine, split, swap, trim, or remove documents, slides, and diagrams in Java applications.

Illustration merger

Effortlessly merge multiple documents in Java

Merge PDF and Office files into a single document effortlessly in Java using GroupDocs.Merger. With its wide format support, you can combine various file types seamlessly, simplifying the merging process and enhancing productivity.

Streamline document management by dividing bulky files easily

Break down large PDF or Office files into smaller, more manageable sections. Split documents by specific pages, ranges, or extract individual pages with ease. GroupDocs.Merger simplifies document organization, making your files easier to handle and access.

Customize your document structure and have full control over your files

Take full control of your documents by reordering, swapping, or removing pages. Tailor your files to meet specific needs with the flexibility to create a customized document structure using GroupDocs.Merger.

Platform independence

GroupDocs.Merger for Java is designed to work seamlessly across various operating systems, frameworks, and package managers, ensuring flexibility and compatibility for your development needs.

Amazon
Docker
Azure
Eclipse
IntelliJ
Windows
Linux
Maven

Supported file formats

GroupDocs.Merger for Java enables seamless operations with a wide range of file formats.

Microsoft Office formats

  • Word: DOC, DOCX, DOCM, DOT, DOTX, DOTM, RTF, TXT
  • Excel: XLS, XLSX, XLSM, XLSB, XLTM, XLTX, XLT, XLAM
  • PowerPoint: PPT, PPTX, PPS, PPSX, ODP, OTP
  • Visio: VSDX, VSDM, VSSX, VSTX, VSTM, VSSM, VSX, VTX, VDX

Documents & images

  • Documents: PDF, XPS, TEX
  • Images: BMP, JPEG, PNG, GIF, TIFF, SVG, PS
  • OpenDocument: ODT, OTT, ODS
  • eBook: EPUB

Other formats

  • Web: HTML, MHTML, MHT
  • Archives: ZIP, TAR, RAR, 7Z, BZ2, GZ
  • OneNote: ONE

GroupDocs.Merger features

Easily merge, split, and manipulate PDF and Office documents with powerful tools.

Feature icon

Combine files

Merge multiple documents into one, selecting specific pages or page ranges from different source files.

Feature icon

Split document

Break a document into multiple smaller files, making it easier to manage and organize content.

Feature icon

Move pages

Reorder your document by moving pages to a new position with the MovePage feature.

Feature icon

Remove pages

Delete individual pages or a set of specific pages from a document using the RemovePages feature.

Feature icon

Rotate pages

Rotate pages in a document by 90, 180, or 270 degrees with the RotatePages feature.

Feature icon

Swap pages

Change the order of pages by swapping two pages within the document.

Feature icon

Extract pages

Create a new document containing only selected pages by extracting specific pages or page ranges.

Feature icon

Change orientation

Switch page orientation between portrait and landscape for specific or all pages in a document.

Feature icon

Preview pages

Generate image previews of document pages to get a better view of their content and layout.

Code samples

Examples of common GroupDocs.Merger operations in Java

Merge DOCX files into a single document

With the Merge Word Documents feature, you can easily combine multiple DOCX files into one. Load the source document, add additional DOCX files, and save the merged result. Below is a Java code snippet demonstrating the merging process:

How to merge DOCX files in Java

// Load the source DOCX file
Merger merger = new Merger("sample1.docx");
// Add another DOCX file to combine
merger.join("sample2.docx");
// Merge DOCX files and save the output
merger.save("merged.docx");

Split a PDF document into multiple files

Use the Split Document feature to break a large PDF into smaller, more manageable files. This is useful for extracting specific sections or pages. You can split a document using various criteria, such as page range, specific start and end pages, or even odd/even page numbers.

Split a document into multiple one-page files

// Split a PDF file using GroupDocs.Merger for Java API
String filePath = "input.pdf";
String filePathOut = "output.pdf";

// Initialize the SplitOptions class with the output file format
SplitOptions splitOptions = new SplitOptions(filePathOut, new int[] { 3, 6, 8 });

// Create a Merger instance with the input PDF document
Merger merger = new Merger(filePath);

// Call the split method with the SplitOptions object to generate separate files
merger.split(splitOptions);

Ready to get started?

Download GroupDocs.Merger for free or get a trial license for full access!

Useful resources

Explore documentation, code samples, and community support to enhance your experience.

Temporary license tips

1
Sign up with your work email.
Free mail services are not allowed.
2
Use Get a temporary license button on the second step.
 English