Split and Merge Documents with Java SDK

Java SDK as a wrapper for the GroupDocs.Merger Cloud API. Combine documents into one, split document into many in your Java applications.

  • GroupDocs.Merger Cloud for cURL
  • GroupDocs.Merger Cloud SDK for .NET
  • GroupDocs.Merger Cloud SDK for PHP
  • GroupDocs.Merger Cloud SDK for Python
  • GroupDocs.Merger Cloud SDK for Ruby
  • GroupDocs.Merger Cloud SDK for Node.js
  • GroupDocs.Merger Cloud SDK for Android
Start Free Trial

GroupDocs.Merger Cloud SDK for Java is a wrapper to communicate with the Cloud API for Java developers. The GroupDocs.Merger Cloud API is a REST service to merge and split documents and supports a wide range of Microsoft Office, OpenDocument, eBook, PDF, text, LaTeX and other document formats. The GroupDocs.Merger Cloud API provides a way to combine two or more documents into one, split any document to many, and generate image representation of any document in PNG, JPG to BMP format. The API offers many other document pages related operations like rotate any page of a PDF document, swap slides of presentations or change page orientation of word documents. The API gives importance to security and allows to apply or remove the password protection to your important business documents.

Document Merger REST API Features

Combine multiple pages, slides or spreadsheets into a single document

Swap position of any two pages, slides or sheets within a document

Rotate pages by setting rotation angles like 90, 180 or 270 degrees

Split any document into smaller files

Remove any single or collection of specific pages

Change page orientation

Rearrange pages, slides or diagrams

Set, reset & remove password

Fetch list of supported file formats

Merge multiple documents

Using GroupDocs.Merger Cloud API, you can combine two or more documents into one, or split any document into multiple smaller documents. Following few lines of code shows how to combine two word files in Java.

Merge word documents - Java

  //Get your App SID and App Key at https://dashboard.groupdocs.cloud (free registration is required).
  Configuration configuration = new Configuration(MyAppSid, MyAppKey);
  DocumentApi apiInstance = new DocumentApi(configuration);

  FileInfo fileInfo1 = new FileInfo();         
  JoinItem item1 = new JoinItem();

  FileInfo fileInfo2 = new FileInfo();            
  JoinItem item2 = new JoinItem();

  JoinOptions options = new JoinOptions();
  options.setJoinItems(Arrays.asList(item1, item2));

  JoinRequest request = new JoinRequest(options);
  DocumentResult response = apiInstance.join(request);			

GroupDocs.Merger Cloud also offers individual document merger SDKs for other languages as listed below: