<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-merger-cloud</artifactId>
<version>24.7</version>
</dependency>
copied!  
compile(group: 'com.groupdocs', name: 'groupdocs-merger-cloud', version: '24.7')
copied!  
<dependency org="com.groupdocs" name="groupdocs-merger-cloud" rev="24.7">
 <artifact name="groupdocs-merger-cloud" ext="jar"/>
</dependency>
copied!  
libraryDependencies += "com.groupdocs" % "groupdocs-merger-cloud" % "24.7"
copied!  

Document Merger Java Cloud REST API

main-banner

Product Page | Docs | Live Demos | Swagger UI | Code Samples | Blog | Free Support | Free Trial

GroupDocs.Merger Cloud SDK for Java helps you build cloud Document Merger Java Apps that work without installing any 3rd party software. It is a wrapper around GroupDocs.Merger Cloud REST APIs.

Cloud Document Merging SDK Features

Supported Document Merger File Formats

Microsoft Word®: DOC, DOCX, DOCM, DOT, DOTX, DOTM, RTF, TXT
OpenOffice Writer®: ODT, OTT
Microsoft Excel®: XLS, XLSX, XLSB, XLSM, XLT, XLTX, XLTM, CSV, TSV
OpenOffice Calc®: ODS
Microsoft PowerPoint®: PPT, PPTX, PPS, PPSX
OpenOffice Impress®: ODP, OTP
Microsoft Visio®: VSDX, VSDM, VSSX, VSSM, VSTX, VSTM, VDX, VSX, VTX
Microsoft OneNote®: ONE
Other: ERR

Requirements

Building the API client library requires:

  1. Java 1.7+
  2. Maven

Prerequisites

To use GroupDocs.Merger Cloud SDK for Java you need to register an account with GroupDocs Cloud and lookup/create Client ID and Client Secret at Cloud Dashboard. There is free quota available. For more details, see GroupDocs Cloud Pricing.

Install GroupDocs.Merger-Cloud from Maven

Add GroupDocs Cloud repository to your application pom.xml

<repository>
    <id>repository.groupdocs.cloud</id>
    <name>repository.groupdocs.cloud</name>
    <url>https://releases.groupdocs.cloud/java/repo/</url>
</repository>

Install from source

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project’s POM:

<dependency>
    <groupId>com.groupdocs</groupId>
    <artifactId>groupdocs-merger-cloud</artifactId>
    <version>22.5</version>
</dependency>

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/groupdocs-merger-cloud-22.5.jar
  • target/lib/*.jar

Get Started

Please follow the Quick Start instructions.

Sample Java Code to merge Cloud documents of different formats

// For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-java-samples
String MyClientSecret = ""; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
String MyClientId = ""; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud

Configuration configuration = new Configuration(MyClientId, MyClientSecret);
DocumentApi apiInstance = new DocumentApi(configuration);

try {
    FileInfo fileInfo1 = new FileInfo();   
    fileInfo1.setFilePath("Pdf/one-page-password.pdf");
    fileInfo1.setPassword("password");
    JoinItem item1 = new JoinItem();
    item1.setFileInfo(fileInfo1);

    FileInfo fileInfo2 = new FileInfo();   
    fileInfo2.setFilePath("WordProcessing/one-page.docx");
    JoinItem item2 = new JoinItem();
    item2.setFileInfo(fileInfo2);

    JoinOptions options = new JoinOptions();
    options.setJoinItems(Arrays.asList(item1, item2));
    options.setOutputPath("output/joined.pdf");

    JoinRequest request = new JoinRequest(options);

    DocumentResult response = apiInstance.join(request);

    System.err.println("Output file path: " + response.getPath());

} catch (ApiException e) {

    System.err.println("Exception while calling api:");
    e.printStackTrace();
}

Authorization & Authentication

Authentication schemes defined for the API is as follows:

JWT

Product Page | Docs | Live Demos | Swagger UI | Code Samples | Blog | Free Support | Free Trial

VersionRelease Date
24.7July 24, 2024
23.10October 23, 2023
23.2February 7, 2023
22.5May 13, 2022
21.6January 25, 2022
21.12December 7, 2021
19.10October 24, 2019