Skip to content

groupdocs-assembly-cloud/groupdocs-assembly-cloud-java

Repository files navigation

GroupDocs.Assembly Cloud for Java

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.

How to use the SDK?

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).

Prerequisites

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.

Requirements

Building the API client library requires:

  1. Java 1.7+
  2. Maven/Gradle

Installation

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>GroupDocsAssemblyCloud</artifactId>
  <version>21.1.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "com.groupdocs:GroupDocsAssemblyCloud:21.1.0"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/GroupDocsAssemblyCloud-21.1.0.jar
  • target/lib/*.jar

Getting Started

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();
        }
    }
}

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Contact Us

Product Page | Documentation | API Reference | Code Samples | Blog | Free Support | Free Trial

About

A Java client for GroupDocs.Assembly for Cloud Web API

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages