<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-merger-cloud</artifactId>
<version>22.5</version>
</dependency>
compile(group: 'com.groupdocs', name: 'groupdocs-merger-cloud', version: '22.5')
<dependency org="com.groupdocs" name="groupdocs-merger-cloud" rev="22.5">
<artifact name="groupdocs-merger-cloud" ext="jar"/>
</dependency>
libraryDependencies += "com.groupdocs" % "groupdocs-merger-cloud" % "22.5"
Document Merger Java Cloud REST API
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
- Join two or more documents into a single document in the cloud.
- Join desired specific pages from multiple source cloud documents into a single document.
- Specify page ranges (any start page to any end page) to be merged into a single cloud document.
- Join or merge cloud files of different formats (extensions) into a PDF or word processing document.
- Append two Word® processing documents without page break between them.
- Extract specific pages from a single cloud document to split into multiple single page smaller documents.
- Add or import attachment to PDF files hosted on the cloud storage.
- Apply password protection to the merged cloud documents.
- Apply page orientation (Portrait or Landscape) to all or specific merged cloud document pages.
- Create a new cloud document by extracting specific pages from several source cloud documents.
- Customize page ordering to move desired pages from one location within cloud document to another.
- Rotate specific of all pages of a cloud document at a degree of 90, 180, or 270.
- Swap position of two pages within a cloud document to be exchanged with each other.
- Ability to generate cloud document page preview in
JPG
,PNG
, orBMP
formats.
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:
- Java 1.7+
- 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://repository.groupdocs.cloud/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
- Type: OAuth 2.0
- Flow: application
- Authorization URL: https://api.groupdocs.cloud/connect/token
- Token Lifetime: 1 day (Default)
Product Page | Docs | Live Demos | Swagger UI | Code Samples | Blog | Free Support | Free Trial