Skip to content

Commit 5a5a226

Browse files
committed
Updated sources
1 parent b592ae7 commit 5a5a226

23 files changed

Lines changed: 66 additions & 112 deletions

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2003-2020 Aspose Pty Ltd
3+
Copyright (c) 2003-2019 Aspose Pty Ltd
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

README.md

Lines changed: 29 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,28 @@
1-
![](https://img.shields.io/badge/api-v2.0-lightgrey) ![npm](https://img.shields.io/npm/v/groupdocs-viewer-cloud) ![npm bundle size](https://img.shields.io/bundlephobia/min/groupdocs-viewer-cloud) ![node-current](https://img.shields.io/node/v/groupdocs-viewer-cloud) ![npm type definitions](https://img.shields.io/npm/types/groupdocs-viewer-cloud) [![GitHub license](https://img.shields.io/github/license/groupdocs-viewer-cloud/groupdocs-viewer-cloud-node)](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-node/blob/master/LICENSE)
1+
# GroupDocs.Viewer Cloud Node.js SDK
2+
Node.js module for communicating with the GroupDocs.Viewer Cloud API
23

3-
# Node.js SDK to View Documents in the Cloud
4+
## Installation
45

5-
[GroupDocs.Viewer Cloud SDK for Node.js](https://products.groupdocs.cloud/viewer/nodejs) wraps GroupDocs.Viewer RESTful APIs so you may integrate Document Viewing features in your own apps with zero initial cost.
6-
7-
GroupDocs.Viewer REST API allows the developers to view & render a number of files formats including Word documents, Excel spreadsheets, PowerPoint presentations, PDF, OpenDocument formats, emails, CAD files & images.
8-
9-
## Document Viewer Services in REST
10-
11-
- 90+ supported file formats.
12-
- View documents as PDF, HTML or images.
13-
- Render documents as raster & vector images.
14-
- Render documents with comments & notes.
15-
- Flip or rotate documents pages at 90, 180 or 270 degrees.
16-
- Reorder document pages.
17-
- Render hidden, consecutive or selected document pages.
18-
- Watermark PDF, image or HTML output pages.
19-
- Render with custom fonts as well as replace any missing fonts.
20-
- Load password-protected documents.
21-
- Extract attachment information such as attachment count & names.
22-
- Extract document information like file format, page count, size and visibility, text coordinates, and so on.
23-
- Integrated storage API.
24-
25-
Check out the [Developer's Guide](https://docs.groupdocs.cloud/viewer/developer-guide/) to know more about GroupDocs.Viewer REST API.
26-
27-
## Microsoft File Formats
28-
29-
**Microsoft Word:** DOC, DOCM, DOCX, DOT, DOTM, DOTX\
30-
**Microsoft Excel:** XLS, XLSX, XLSB, XLSM\
31-
**Microsoft PowerPoint:** PPTX, PPTM, PPT, PPSX, PPSM, PPS, POTX, POTM\
32-
**Microsoft Project:** MPP, MPT\
33-
**Microsoft Outlook:** MSG, OST, PST\
34-
**Microsoft Visio:** VDW, VDX, VSD, VSDM, VSDX, VSS, VSSM, VSSX, VST, VSTM, VSTX, VSX, VTX\
35-
**Microsoft OneNote:** ONE
36-
37-
## Other Formats
38-
39-
**Page Layout Formats:** PDF, XPS, TEX\
40-
**OpenDocument:** ODT, OTT, ODS, OTS, ODP, OTP\
41-
**CAD:** DNG, DWF, DWG, DXF, IDC, STL\
42-
**Images:** BMP, CGM, DCM, DJVU, EMP, EPS, GIF, ICO, JP2, JPG, ODG, PCL, PNG, PS, PSD, SVG, TIFF, WEBP, WMF\
43-
**Web:** HTML, MHT, MHTML\
44-
**Emails:** EML, EMLX\
45-
**eBooks:** EPUB, MOBI\
46-
**Others:** TXT, RTF, CSV, TSV
47-
48-
## Get Started with GroupDocs.Viewer Cloud SDK for Node.js
49-
50-
First create an account at [GroupDocs for Cloud](https://dashboard.groupdocs.cloud/) and get your application information. Next, execute the following command to install the package.
6+
A package `groupdocs-viewer-cloud` is available at [npmjs.com](https://www.npmjs.com/package/groupdocs-viewer-cloud). You can install it with:
517

528
```shell
539
npm install groupdocs-viewer-cloud
5410
```
55-
## Get a List of Viewable File Formats
11+
12+
## Getting Started
13+
14+
Please follow the [installation](#installation) procedure and then run the following JavaScript code:
5615

5716
```js
5817
// load the module
5918
var GroupDocs = require('groupdocs-viewer-cloud');
6019

61-
// Get Client Id and Client Secret from https://dashboard.groupdocs.cloud
62-
var myClientId = "";
63-
var myClientSecret = "";
20+
// get your appSid and appKey at https://dashboard.groupdocs.cloud (free registration is required).
21+
var appSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
22+
var appKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
6423

65-
// Create instance of the API
66-
var configuration = new GroupDocs.Configuration(myClientId, myClientSecret);
67-
var infoApi = GroupDocs.InfoApi.fromConfig(configuration);
24+
// construct ViewerApi
25+
var infoApi = GroupDocs.InfoApi.fromKeys(appSid, appKey);
6826

6927
// retrieve supported file-formats
7028
infoApi.getSupportedFileFormats()
@@ -83,15 +41,14 @@ Or compile and run same written in TypeScript:
8341

8442
```ts
8543
// load the module
86-
import { InfoApi, Configuration } from "groupdocs-viewer-cloud";
44+
import { InfoApi } from "groupdocs-viewer-cloud";
8745

88-
// Get Client Id and Client Secret from https://dashboard.groupdocs.cloud
89-
const myClientId: string = "";
90-
const myClientSecret: string = "";
46+
// get your appSid and appKey at https://dashboard.groupdocs.cloud (free registration is required).
47+
const appSid: string = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
48+
const appKey: string = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
9149

92-
// Create instance of the API
93-
const configuration: Configuration = Configuration(myClientId, myClientSecret);
94-
const infoApi: InfoApi = InfoApi.fromConfig(configuration);
50+
// construct ViewerApi
51+
const infoApi: InfoApi = InfoApi.fromKeys(appSid, appKey);
9552

9653
// retrieve supported file-formats
9754
infoApi.getSupportedFileFormats()
@@ -107,11 +64,15 @@ infoApi.getSupportedFileFormats()
10764
```
10865

10966

110-
## GroupDocs.Viewer Cloud SDKs in Popular Languages
67+
## Licensing
68+
GroupDocs.Viewer Cloud Node.js SDK licensed under [MIT License](LICENSE).
11169

112-
| .NET | Java | PHP | Python | Ruby | Node.js | Android |
113-
|---|---|---|---|---|---|---|
114-
| [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-dotnet) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-php) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-python) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-ruby) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-node) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-android) |
115-
| [NuGet](https://www.nuget.org/packages/GroupDocs.Viewer-Cloud/) | [Maven](https://repository.groupdocs.cloud/webapp/#/artifacts/browse/tree/General/repo/com/groupdocs/groupdocs-viewer-cloud) | [Composer](https://packagist.org/packages/groupdocscloud/groupdocs-viewer-cloud) | [PIP](https://pypi.org/project/groupdocs-viewer-cloud/) | [GEM](https://rubygems.org/gems/groupdocs_viewer_cloud) | [NPM](https://www.npmjs.com/package/groupdocs-viewer-cloud) | [Maven](https://repository.groupdocs.cloud/webapp/#/artifacts/browse/tree/General/repo/com/groupdocs/groupdocs-viewer-cloud-android) |
70+
## Resources
71+
+ [**Website**](https://www.groupdocs.cloud)
72+
+ [**Product Home**](https://products.groupdocs.cloud/viewer)
73+
+ [**Documentation**](https://docs.groupdocs.cloud/display/viewercloud/Home)
74+
+ [**Free Support Forum**](https://forum.groupdocs.cloud/c/viewer)
75+
+ [**Blog**](https://blog.groupdocs.cloud/category/viewer)
11676

117-
[Home](https://www.groupdocs.cloud/) | [Product Page](https://products.groupdocs.cloud/viewer/nodejs) | [Documentation](https://docs.groupdocs.cloud/viewer/) | [Live Demo](https://products.groupdocs.app/viewer/total) | [API Reference](https://apireference.groupdocs.cloud/viewer/) | [Code Samples](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-node-samples) | [Blog](https://blog.groupdocs.cloud/category/viewer/) | [Free Support](https://forum.groupdocs.cloud/c/viewer) | [Free Trial](https://dashboard.groupdocs.cloud)
77+
## Contact Us
78+
Your feedback is very important to us. Please feel free to contact us using our [Support Forums](https://forum.groupdocs.cloud/c/viewer).

package-lock.json

Lines changed: 4 additions & 4 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": "groupdocs-viewer-cloud",
3-
"version": "20.5.0",
3+
"version": "21.3.0",
44
"description": "GroupDocs.Viewer Cloud SDK for Node.js",
55
"homepage": "https://products.groupdocs.cloud/viewer",
66
"author": {

src/api_client.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ async function invokeApiMethodInternal(requestOptions: request.Options, config:
104104
} else {
105105
reject({ message: bodyContent.error, code: response.statusCode });
106106
}
107+
} else {
108+
if (bodyContent.message) {
109+
reject({ message: bodyContent.message, code: bodyContent.code });
110+
} else {
111+
reject({ message: bodyContent, code: response.statusCode });
112+
}
107113
}
108114
} catch (error) {
109115
reject({ message: "Error while parse server error: " + error });

src/api_error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2003-2020 Aspose Pty Ltd
4+
* Copyright (c) 2003-2021 Aspose Pty Ltd
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

src/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2003-2020 Aspose Pty Ltd
4+
* Copyright (c) 2003-2021 Aspose Pty Ltd
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

src/configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2003-2020 Aspose Pty Ltd
4+
* Copyright (c) 2003-2021 Aspose Pty Ltd
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

src/model.ts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2003-2020 Aspose Pty Ltd
4+
* Copyright (c) 2003-2021 Aspose Pty Ltd
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -2756,7 +2756,7 @@ export class PdfOptions extends RenderOptions {
27562756
{
27572757
name: "permissions",
27582758
baseName: "permissions",
2759-
type: "PdfOptions.PermissionsEnum",
2759+
type: "Array<string>",
27602760
} ];
27612761

27622762
/**
@@ -2782,28 +2782,16 @@ export class PdfOptions extends RenderOptions {
27822782
public permissionsPassword: string;
27832783

27842784
/**
2785-
* The PDF document permissions such as printing, modification and data extraction
2785+
* The array of PDF document permissions. Allowed values are: AllowAll, DenyPrinting, DenyModification, DenyDataExtraction, DenyAll Default value is AllowAll, if now permissions are set.
27862786
*/
2787-
public permissions: PdfOptions.PermissionsEnum;
2787+
public permissions: Array<string>;
27882788

27892789
public constructor(init?: Partial<PdfOptions>) {
27902790
super(init);
27912791
Object.assign(this, init);
27922792
}
27932793
}
27942794

2795-
// tslint:disable:quotemark
2796-
// tslint:disable-next-line:no-namespace
2797-
export namespace PdfOptions {
2798-
export enum PermissionsEnum {
2799-
AllowAll = 'AllowAll' as any,
2800-
DenyPrinting = 'DenyPrinting' as any,
2801-
DenyModification = 'DenyModification' as any,
2802-
DenyDataExtraction = 'DenyDataExtraction' as any,
2803-
DenyAll = 'DenyAll' as any,
2804-
}
2805-
}
2806-
// tslint:enable:quotemark
28072795
/**
28082796
* Represents relatively positioned rectangle which contains single word
28092797
*/
@@ -2846,7 +2834,6 @@ const enumsMap = {
28462834
"SpreadsheetOptions.TextOverflowModeEnum": SpreadsheetOptions.TextOverflowModeEnum,
28472835
"ViewOptions.ViewFormatEnum": ViewOptions.ViewFormatEnum,
28482836
"Watermark.PositionEnum": Watermark.PositionEnum,
2849-
"PdfOptions.PermissionsEnum": PdfOptions.PermissionsEnum,
28502837
};
28512838

28522839
const typeMap = {

src/package_version.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2003-2020 Aspose Pty Ltd
4+
* Copyright (c) 2003-2021 Aspose Pty Ltd
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -25,4 +25,4 @@
2525
/**
2626
* Package version
2727
*/
28-
export const PackageVersion: string = "20.5.0";
28+
export const PackageVersion: string = "21.3.0";

0 commit comments

Comments
 (0)