Browse our Products

If so you can download any of the below versions for testing. The product will function as normal except for an evaluation limitation. At the time of purchase we provide a license file via email that will allow the product to work in its full capacity. If you would also like an evaluation license to test without any restrictions for 30 days, please follow the directions provided here.


Product Docs Swagger Examples Blog Support Dashboard

Installation

The package is available at npmjs.com and it can be installed via npm by executing the following command:

npm install groupdocs-assembly-cloud

NPM Version NPM Downloads NPM-GroupDocsCloud


Requirements

Dependencies

The SDK requires the following packages:

PackageConstraint
@types/request^2.48.4
blob^0.1.0
request^2.88.2
request-debug^0.2.0
uuid^7.0.3

Quick Start

Get your API credentials

To use GroupDocs.Assembly Cloud, sign up at GroupDocs.Cloud Dashboard and get your Client ID and Client Secret.

Initialize the API

Use the following code to start using the GroupDocs.Assembly Cloud SDK for Node.js. The first argument is the Client ID and the second argument is the Client Secret.

"use strict";
const { AssemblyApi } = require("groupdocs-assembly-cloud");

const assemblyApi = new AssemblyApi("YourClientId", "YourClientSecret", "https://api.groupdocs.cloud");

See baseTest.ts for more details.

Assemble a document

Once initialized, use this basic example to build a PDF report from a DOCX template and JSON data.

"use strict";
const { AssemblyApi, AssembleOptions, TemplateFileInfo, AssembleDocumentRequest } = require("groupdocs-assembly-cloud");
const { readFileSync } = require("fs");

const assemblyApi = new AssemblyApi("YourClientId", "YourClientSecret", "https://api.groupdocs.cloud");

const assembleOptionsData = new AssembleOptions({
    saveFormat: "pdf",
    reportData: readFileSync("./TestData/Teams.json", "utf8"),
    templateFileInfo: new TemplateFileInfo({
        filePath: "Temp/SdkTests/node/TestData/GroupDocs.Assembly/TestAllChartTypes.docx",
    }),
});
const request = new AssembleDocumentRequest({
    assembleOptions: assembleOptionsData,
});

assemblyApi.assembleDocument(request).then((result) => {
    console.log("Document assembled: " + result.body.byteLength);
});

See apiTest.ts for more details.

Upload a Template

This example uploads a template into cloud storage before assembly.

"use strict";
const { AssemblyApi, UploadFileRequest } = require("groupdocs-assembly-cloud");
const { createReadStream } = require("fs");

const assemblyApi = new AssemblyApi("YourClientId", "YourClientSecret", "https://api.groupdocs.cloud");

const request = new UploadFileRequest({
    fileContent: createReadStream("./TestData/TestAllChartTypes.docx"),
    path: "Temp/SdkTests/node/TestData/GroupDocs.Assembly/TestAllChartTypes.docx",
});

assemblyApi.uploadFile(request);

See apiTest.ts for more details.

Get Supported Assembly Formats

Retrieve the file formats the API can assemble.

"use strict";
const { AssemblyApi, GetSupportedFileFormatsRequest } = require("groupdocs-assembly-cloud");

const assemblyApi = new AssemblyApi("YourClientId", "YourClientSecret", "https://api.groupdocs.cloud");

const request = new GetSupportedFileFormatsRequest();
assemblyApi.getSupportedFileFormats(request);

See api.ts for more details.

List Files in Storage

This example lists files in a cloud storage folder.

"use strict";
const { AssemblyApi, GetFilesListRequest } = require("groupdocs-assembly-cloud");

const assemblyApi = new AssemblyApi("YourClientId", "YourClientSecret", "https://api.groupdocs.cloud");

const request = new GetFilesListRequest({ path: "/Folder1" });
assemblyApi.getFilesList(request);

See model.ts for more details.

Examples on GitHub

The GroupDocs.Assembly Cloud Node.js SDK repository includes the SDK and tests covering:

CategoryExamples
AssemblyAssemble a document from a template and JSON data
StorageUpload, download, copy, move, and delete files and folders
InfoSupported file formats

How to run the examples

  1. Clone or download the SDK repository
  2. Create testConfig.json in the project root and set AppSid, AppKey, and BaseUrl
  3. Run npm install
  4. The tests are in test/apiTest.ts
  5. Execute npm test

For more details, visit Getting Started.


Product Docs Swagger Examples Blog Support Dashboard


Tags

Document Automation | Node.js Cloud API | GroupDocs.Assembly Cloud | REST API | Document Generation | Template-Driven | Dynamic Data Merging | Rich Formatting | Conditional Content Control | List Automation | Table Automation | Barcode Generation | Hyperlink Insertion | Bookmark Creation | Checkbox Manipulation | Mail Merge | Formula Calculations | Chart Generation | Data Filtering | Data Sorting | Data Grouping | JWT Authentication | Microsoft Word | Microsoft Excel | Microsoft PowerPoint | Report Generation | Cloud-Based Flexibility | Secure API Access | Cross-platform API



 English