Skip to content

Commit e8b7adf

Browse files
Adding SVG conversions
1 parent dd0259c commit e8b7adf

28 files changed

+478
-43
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# Aspose.Html Cloud Node.js SDK
22
[Aspose.Html Cloud](https://products.aspose.cloud/html) is a true [REST API](https://apireference.aspose.cloud/html/) that enables you to perform a wide range of html processing operations including manipulation and conversion in the cloud, with zero initial costs. Our Cloud SDKs are wrappers around REST API in various programming languages, allowing you to process html pages in language of your choice quickly and easily, gaining all benefits of strong types and IDE highlights.
33

4-
- API version: 22.10.1
5-
- Package version: 22.10.1
4+
- API version: 22.11.1
5+
- Package version: 22.11.1
66

77

88
### Possible conversions:
99
- HTML -> PDF, XPS, DOCX, MD, MHTML, JPEG, BMP, PNG, TIFF, GIF
1010
- EPUB -> PDF, XPS, DOCX, JPEG, BMP, PNG, TIFF, GIF
1111
- MD -> PDF, XPS, DOCX, HTML, MHTML, JPEG, BMP, PNG, TIFF, GIF
1212
- MHTML -> PDF, XPS, DOCX, JPEG, BMP, PNG, TIFF, GIF
13+
- SVG -> PDF, XPS, JPEG, BMP, PNG, TIFF, GIF
14+
- JPEG, BMP, PNG, TIFF, GIF -> SVG
1315

1416
## Installation
1517

@@ -50,7 +52,7 @@ Please, add the following [nmp package](https://www.npmjs.com/package/@asposeclo
5052
```json
5153
{
5254
"dependencies": {
53-
"@asposecloud/aspose-html-cloud":"^22.10.1"
55+
"@asposecloud/aspose-html-cloud":"^22.11.1"
5456
}
5557
}
5658
```
@@ -183,15 +185,15 @@ All URIs are relative to *https://api.aspose.cloud/v4.0*
183185
### HTML API
184186
- For conversion to images allowed formats is jpeg, png, bmp, tiff, gif. Input formats are html, epub, svg.
185187

186-
| Class | Method | Description |
187-
|---------------------------------|------------------------------------------------------------------------------|--------------------------------------------------------------------------|
188-
| *Asposehtmlcloud.ConversionApi* | [**convertLocalToLocal**](docs/ConversionApi.md#convertlocaltolocal) | Convert the HTML or EPUB document from local disk to a local disk. |
189-
| *Asposehtmlcloud.ConversionApi* | [**convertLocalToStorage**](docs/ConversionApi.md#convertlocaltostorage) | Convert the HTML or EPUB document from local disk to user's storage. |
190-
| *Asposehtmlcloud.ConversionApi* | [**convertStorageToLocal**](docs/ConversionApi.md#convertstoragetolocal) | Convert the HTML or EPUB document from user's storage to local disk. |
191-
| *Asposehtmlcloud.ConversionApi* | [**convertStorageToStorage**](docs/ConversionApi.md#convertstoragetostorage) | Convert the HTML or EPUB document from user's storage to user's storage. |
192-
| *Asposehtmlcloud.ConversionApi* | [**convertUrlToLocal**](docs/ConversionApi.md#converturltolocal) | Convert the HTML document by URL to local disk. |
193-
| *Asposehtmlcloud.ConversionApi* | [**convertUrlToStorage**](docs/ConversionApi.md#converturltostorage) | Convert the HTML document by URL to user's storage. |
194-
| *Asposehtmlcloud.ConversionApi* | [**convert**](docs/ConversionApi.md#convert) | Convert the HTML, EPUB or URL to the specified format. |
188+
| Class | Method | Description |
189+
|---------------------------------|------------------------------------------------------------------------------|-----------------------------------------------------------|
190+
| *Asposehtmlcloud.ConversionApi* | [**convertLocalToLocal**](docs/ConversionApi.md#convertlocaltolocal) | Convert a document from local disk to a local disk. |
191+
| *Asposehtmlcloud.ConversionApi* | [**convertLocalToStorage**](docs/ConversionApi.md#convertlocaltostorage) | Convert a document from local disk to user's storage. |
192+
| *Asposehtmlcloud.ConversionApi* | [**convertStorageToLocal**](docs/ConversionApi.md#convertstoragetolocal) | Convert a document from user's storage to local disk. |
193+
| *Asposehtmlcloud.ConversionApi* | [**convertStorageToStorage**](docs/ConversionApi.md#convertstoragetostorage) | Convert a document from user's storage to user's storage. |
194+
| *Asposehtmlcloud.ConversionApi* | [**convertUrlToLocal**](docs/ConversionApi.md#converturltolocal) | Convert the HTML document by URL to local disk. |
195+
| *Asposehtmlcloud.ConversionApi* | [**convertUrlToStorage**](docs/ConversionApi.md#converturltostorage) | Convert the HTML document by URL to user's storage. |
196+
| *Asposehtmlcloud.ConversionApi* | [**convert**](docs/ConversionApi.md#convert) | Convert a document to the specified format. |
195197

196198
<a name="storage_api"></a>
197199
## STORAGE API
6.34 MB
Binary file not shown.

docs/ConversionApi.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,29 @@ All URIs are relative to *https://api.aspose.cloud/v4.0*
77
- EPUB -> PDF, XPS, DOCX, JPEG, BMP, PNG, TIFF, GIF
88
- MD -> PDF, XPS, DOCX, HTML, MHTML, JPEG, BMP, PNG, TIFF, GIF
99
- MHTML -> PDF, XPS, DOCX, JPEG, BMP, PNG, TIFF, GIF
10-
11-
| Method | Description |
12-
|---------------------------------------------------------|--------------------------------------------------------------------------|
13-
| [**convertLocalToLocal**](#convertlocaltolocal) | Convert the HTML or EPUB document from local disk to a local disk. |
14-
| [**convertLocalToStorage**](#convertlocaltostorage) | Convert the HTML or EPUB document from local disk to user's storage. |
15-
| [**convertStorageToLocal**](#convertstoragetolocal) | Convert the HTML or EPUB document from user's storage to local disk. |
16-
| [**convertStorageToStorage**](#convertstoragetostorage) | Convert the HTML or EPUB document from user's storage to user's storage. |
17-
| [**convertUrlToLocal**](#converturltolocal) | Convert the HTML document by URL to local disk. |
18-
| [**convertUrlToStorage**](#converturltostorage) | Convert the HTML document by URL to user's storage. |
19-
| [**convert**](#convert) | Convert the HTML, EPUB or URL to the specified format. |
10+
- SVG -> PDF, XPS, JPEG, BMP, PNG, TIFF, GIF
11+
- JPEG, BMP, PNG, TIFF, GIF -> SVG
12+
13+
14+
| Method | Description |
15+
|---------------------------------------------------------|-----------------------------------------------------------|
16+
| [**convertLocalToLocal**](#convertlocaltolocal) | Convert a document from local disk to a local disk. |
17+
| [**convertLocalToStorage**](#convertlocaltostorage) | Convert a document from local disk to user's storage. |
18+
| [**convertStorageToLocal**](#convertstoragetolocal) | Convert a document from user's storage to local disk. |
19+
| [**convertStorageToStorage**](#convertstoragetostorage) | Convert a document from user's storage to user's storage. |
20+
| [**convertUrlToLocal**](#converturltolocal) | Convert the HTML document by URL to local disk. |
21+
| [**convertUrlToStorage**](#converturltostorage) | Convert the HTML document by URL to user's storage. |
22+
| [**convert**](#convert) | Convert a document to the specified format. |
23+
24+
## conversionOptions
25+
| Options | Description |
26+
|-------------------------------------------------------------|---------------------------------------------------|
27+
| [**PDFOptions**](ConversionOptions.md#PDFOptions) | Convert to the PDF format. |
28+
| [**ImageOptions**](ConversionOptions.md#ImageOptions) | Convert to images (JPEG, PNG, GIF, TIFF, BMP). |
29+
| [**XPSOptions**](ConversionOptions.md#XPSOptions) | Convert to the XPS format. |
30+
| [**DocOptions**](ConversionOptions.md#DocOptions) | Convert to the DOCX format. |
31+
| [**SvgOptions**](ConversionOptions.md#SvgOptions) | Trace images to the SVG format. |
32+
| [**MarkdownOptions**](ConversionOptions.md#MarkdownOptions) | Convert the HTML document to the markdown format. |
2033

2134
## convertLocalToLocal
2235
> convertLocalToLocal(src, dst, opts, function (err, data, res);

docs/ConversionOptions.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
## ConversionOptions
2+
3+
### PDFOptions
4+
| Field | Type | Description | Note |
5+
|------------------|--------|-------------------------------------------------------------|----------|
6+
| **width** | Number | Width in inches | Optional |
7+
| **height** | Number | Height in inches | Optional |
8+
| **leftmargin** | Number | Left margin in inches | Optional |
9+
| **rightmargin** | Number | Right margin in inches | Optional |
10+
| **topmargin** | Number | Top margin in inches | Optional |
11+
| **bottommargin** | Number | Bottom margin in inches | Optional |
12+
| **jpegquality** | Number | Quality in percent | Optional |
13+
| **background** | String | CSS background like '#FF0000'. For conversion from SVG only | Optional |
14+
15+
### ImageOptions
16+
17+
- for JPEG, BMP, PNG, TIFF, GIF formats
18+
19+
| Field | Type | Description | Note |
20+
|------------------|--------|-------------------------------------------------------------|----------|
21+
| **width** | Number | Width in pixel | Optional |
22+
| **height** | Number | Height in pixel | Optional |
23+
| **leftmargin** | Number | Left margin in pixel | Optional |
24+
| **rightmargin** | Number | Right margin in pixel | Optional |
25+
| **topmargin** | Number | Top margin in pixel | Optional |
26+
| **bottommargin** | Number | Bottom margin in pixel | Optional |
27+
| **background** | String | CSS background like '#FF0000'. For conversion from SVG only | Optional |
28+
29+
### XPSOptions
30+
| Field | Type | Description | Note |
31+
|------------------|--------|--------------------------------------------------------------|----------|
32+
| **width** | Number | Width in inches | Optional |
33+
| **height** | Number | Height in inches | Optional |
34+
| **leftmargin** | Number | Left margin in inches | Optional |
35+
| **rightmargin** | Number | Right margin in inches | Optional |
36+
| **topmargin** | Number | Top margin in inches | Optional |
37+
| **bottommargin** | Number | Bottom margin in inches | Optional |
38+
| **background** | String | CSS background like '#FF0000'. For conversion from SVG only | Optional |
39+
40+
### DocOptions
41+
| Field | Type | Description | Note |
42+
|------------------|--------|--------------------------------------------------------------|----------|
43+
| **width** | Number | Width in inches | Optional |
44+
| **height** | Number | Height in inches | Optional |
45+
| **leftmargin** | Number | Left margin in inches | Optional |
46+
| **rightmargin** | Number | Right margin in inches | Optional |
47+
| **topmargin** | Number | Top margin in inches | Optional |
48+
| **bottommargin** | Number | Bottom margin in inches | Optional |
49+
50+
### SvgOptions
51+
| Field | Type | Description | Note |
52+
|---------------------|--------|----------------------------------------------------------------------------------------------------------|----------|
53+
| **error_threshold** | Number | This parameter defines maximum deviation of poNumbers to fitted curve. By default it is 30. | Optional |
54+
| **max_iterations** | Number | This parameter defines number of iteration for least-squares approximation method. By default it is 30. | Optional |
55+
| **colors_limit** | Number | The maximum number of colors used to quantize an image. Default value is 25. | Optional |
56+
| **line_width** | Number | The value of this parameter is affected by the graphics scale. Default value is 1. | Optional |
57+
58+
59+
### MarkdownOptions
60+
| Field | Type | Description | Note |
61+
|------------------|---------|-----------------------------------------------|----------|
62+
| **usegit** | Boolean | Use git flavor. True or False. Default false. | Optional |

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@asposecloud/aspose-html-cloud",
3-
"version": "22.10.1",
3+
"version": "22.11.1",
44
"description": "Aspose.Html Cloud Node.js SDK",
55
"license": "MIT",
66
"main": "./src/index.js",

src/ApiClient.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
/**
4646
* @module ApiClient
47-
* @version 22.10.1
47+
* @version 22.11.1
4848
*/
4949

5050
/**
@@ -124,7 +124,7 @@
124124
"User-Agent":conf['defaultUserAgent'],
125125
"Authorization":"Bearer " + this.accessToken,
126126
"x-aspose-client":"aspose.html-cloud nodejs sdk",
127-
"x-aspose-client-version":"22.10.1"
127+
"x-aspose-client-version":"22.11.1"
128128
};
129129
};
130130

src/api/ConversionApi.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const helper = require("../../test/helper");
4646
/**
4747
* Conversion service.
4848
* @module api/ConversionApi
49-
* @version 22.10.1
49+
* @version 22.11.1
5050
*/
5151

5252
/**
@@ -286,6 +286,12 @@ const helper = require("../../test/helper");
286286
case 'mhtml':
287287
inputFormat = 'mhtml';
288288
break;
289+
case 'jpg':
290+
inputFormat ='jpeg';
291+
break;
292+
case 'tif':
293+
inputFormat = 'tiff';
294+
break;
289295
default:
290296
inputFormat = ext;
291297
}

src/api/StorageApi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
/**
7777
* Storage service.
7878
* @module api/StorageApi
79-
* @version 22.10.1
79+
* @version 22.11.1
8080
*/
8181

8282
/**

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
* </pre>
7171
* </p>
7272
* @module index
73-
* @version 22.10.1
73+
* @version 22.11.1
7474
*/
7575
var exports = {
7676
/**

src/model/DiscUsage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
/**
4646
* The DiscUsage model module.
4747
* @module model/DiscUsage
48-
* @version 22.10.1
48+
* @version 22.11.1
4949
*/
5050

5151
/**

src/model/Error.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
/**
4646
* The Error model module.
4747
* @module model/Error
48-
* @version 22.10.1
48+
* @version 22.11.1
4949
*/
5050

5151
/**

src/model/ErrorDetails.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
/**
4646
* The ErrorDetails model module.
4747
* @module model/ErrorDetails
48-
* @version 22.10.1
48+
* @version 22.11.1
4949
*/
5050

5151
/**

src/model/FileVersion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
/**
4747
* The FileVersion model module.
4848
* @module model/FileVersion
49-
* @version 22.10.1
49+
* @version 22.11.1
5050
*/
5151

5252
/**

src/model/FileVersions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
/**
4646
* The FileVersions model module.
4747
* @module model/FileVersions
48-
* @version 22.10.1
48+
* @version 22.11.1
4949
*/
5050
/**
5151
* Constructs a new <code>FileVersions</code>.

src/model/FilesList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
/**
4646
* The FilesList model module.
4747
* @module model/FilesList
48-
* @version 22.10.1
48+
* @version 22.11.1
4949
*/
5050

5151
/**

src/model/FilesUploadResult.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
/**
4646
* The FilesUploadResult model module.
4747
* @module model/FilesUploadResult
48-
* @version 22.10.1
48+
* @version 22.11.1
4949
*/
5050

5151
/**

src/model/ObjectExist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
/**
4646
* The ObjectExist model module.
4747
* @module model/ObjectExist
48-
* @version 22.10.1
48+
* @version 22.11.1
4949
*/
5050

5151
/**

src/model/StorageExist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
/**
4747
* The StorageExist model module.
4848
* @module model/StorageExist
49-
* @version 22.10.1
49+
* @version 22.11.1
5050
*/
5151

5252
/**

src/model/StorageFile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
/**
4646
* The StorageFile model module.
4747
* @module model/StorageFile
48-
* @version 22.10.1
48+
* @version 22.11.1
4949
*/
5050

5151
/**

0 commit comments

Comments
 (0)