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.


Docs Swagger Examples Blog Support Release Notes Dashboard

Installation

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

> npm install @asposecloud/aspose-html-cloud --save

NPM Version NPM Downloads NPM-asposeCloud


Aspose.HTML Cloud SDK for Nodejs

The Aspose.HTML Cloud SDK for Nodejs allows your applications to work with HTML documents stored in the cloud. You can render HTML in its native form or convert it into multiple formats such as PDF, XPS, DOCX, JPEG, PNG, TIFF, BMP, GIF, Markdown, and MHTML.

In addition to document conversion, the API supports image vectorization, enabling you to transform raster images (JPEG, PNG, TIFF, BMP, GIF) into scalable SVG graphics for high-quality, resolution-independent output.


Read & Write HTML Formats

HTML, XHTML, zipped HTML, zipped XHTML, MHTML, HTML containing SVG markup, Markdown, SVG

Save HTML As

Microsoft Word: DOCX
Fixed Layout: PDF, XPS
Images: JPEG, PNG, BMP, TIFF, GIF
Web Formats MHTML, Markdown

Read Formats

eBook: EPUB
Other: XML


Convert HTML to JPG Using Aspose.HTML Cloud SDK for Nodejs

This example shows how to use the Aspose.HTML Cloud SDK for Node.js to convert an HTML file to a JPEG image. The code sets up API credentials, initializes the Conversion API, and performs the conversion locally, saving the resulting file to the specified path. The callback function handles the API response and any errors.

// Configuration object for Aspose.HTML Cloud
var conf = {
    "basePath": "https://api.aspose.cloud/v4.0",
    "authPath": "https://api.aspose.cloud/connect/token",
    "apiKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "appSID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    "defaultUserAgent": "NodeJsWebkit"
};

// Import Aspose.HTML Cloud SDK
var api = require('@asposecloud/aspose-html-cloud');

// Create Conversion API instance with configuration
var conversionApi = new api.ConversionApi(conf);

// Define source and destination file paths
var src = "/path/to/src/test.html";  // Source HTML file
var dst = "/path/to/dst/test.jpeg";  // Output JPEG file

// Conversion options (null means default settings)
var opts = null;

// Callback to handle the API response
var callback = function(error, data, response) {
  if (error) {
    console.error(error);   // Log any error
  } else {
    console.log(data);      // Log response data on success
  }
};

// Perform local-to-local conversion: HTML → JPEG
conversionApi.convertLocalToLocal(src, dst, opts, callback);
 English