This repository contains GroupDocs.Assembly Cloud SDK for Java source code. This SDK allows you to work with GroupDocs.Assembly Cloud REST APIs in your Java applications quickly and easily, with zero initial cost.
See API Reference for full API specification.
The complete source code is available in this repository folder. You can either directly use it in your project via source code or get Maven (recommended).
To use GroupDocs.Assembly for Cloud Java SDK you need to register an account with GroupDocs Cloud and lookup/create App Key and SID at Cloud Dashboard. There is free quota available. For more details, see GroupDocs Cloud Pricing.
Building the API client library requires:
- Java 1.7+
- Maven/Gradle
To install the API client library to your local Maven repository, simply execute:
mvn clean installTo deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deployRefer to the OSSRH Guide for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>GroupDocsAssemblyCloud</artifactId>
<version>21.1.0</version>
<scope>compile</scope>
</dependency>Add this dependency to your project's build file:
compile "com.groupdocs:GroupDocsAssemblyCloud:21.1.0"At first generate the JAR by executing:
mvn clean packageThen manually install the following JARs:
target/GroupDocsAssemblyCloud-21.1.0.jartarget/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import com.groupdocs.assembly.*;
import com.groupdocs.assembly.auth.*;
import com.groupdocs.assembly.model.*;
import com.groupdocs.assembly.api.AssemblyApi;
import java.io.File;
import java.util.*;
public class AssemblyApiExample {
public static void main(String[] args) {
AssemblyApi apiInstance = new AssemblyApi();
AssembleOptions saveOptions = new AssembleOptions();
saveOptions.setTemplateFileInfo(new TemplateFileInfo().filePath(Paths.get(pathtoFile).toString()));
saveOptions.setSaveFormat("pdf");
saveOptions.setReportData(new String(Files.readAllBytes(Paths.get(pathToData))));
try {
AssembleDocumentRequest request = new AssembleDocumentRequest(saveOptions);
File response = TestInitializer.assemblyApi.assembleDocument(request);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssemblyApi#postAssembleDocument");
e.printStackTrace();
}
}
}It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.
Product Page | Documentation | API Reference | Code Samples | Blog | Free Support | Free Trial