You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](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
2
3
3
-
#Node.js SDK to View Documents in the Cloud
4
+
## Installation
4
5
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.
## 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:
51
7
52
8
```shell
53
9
npm install groupdocs-viewer-cloud
54
10
```
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:
56
15
57
16
```js
58
17
// load the module
59
18
var GroupDocs =require('groupdocs-viewer-cloud');
60
19
61
-
//Get Client Id and Client Secret from https://dashboard.groupdocs.cloud
62
-
varmyClientId="";
63
-
varmyClientSecret="";
20
+
//get your appSid and appKey at https://dashboard.groupdocs.cloud (free registration is required).
21
+
varappSid="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
22
+
varappKey="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
64
23
65
-
// Create instance of the API
66
-
var configuration =newGroupDocs.Configuration(myClientId, myClientSecret);
67
-
var infoApi =GroupDocs.InfoApi.fromConfig(configuration);
24
+
// construct ViewerApi
25
+
var infoApi =GroupDocs.InfoApi.fromKeys(appSid, appKey);
68
26
69
27
// retrieve supported file-formats
70
28
infoApi.getSupportedFileFormats()
@@ -83,15 +41,14 @@ Or compile and run same written in TypeScript:
Copy file name to clipboardExpand all lines: src/model.ts
+4-17Lines changed: 4 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
/*
2
2
* The MIT License (MIT)
3
3
*
4
-
* Copyright (c) 2003-2020 Aspose Pty Ltd
4
+
* Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
*
6
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
* of this software and associated documentation files (the "Software"), to deal
@@ -2756,7 +2756,7 @@ export class PdfOptions extends RenderOptions {
2756
2756
{
2757
2757
name: "permissions",
2758
2758
baseName: "permissions",
2759
-
type: "PdfOptions.PermissionsEnum",
2759
+
type: "Array<string>",
2760
2760
}];
2761
2761
2762
2762
/**
@@ -2782,28 +2782,16 @@ export class PdfOptions extends RenderOptions {
2782
2782
publicpermissionsPassword: string;
2783
2783
2784
2784
/**
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.
2786
2786
*/
2787
-
publicpermissions: PdfOptions.PermissionsEnum;
2787
+
publicpermissions: Array<string>;
2788
2788
2789
2789
publicconstructor(init?: Partial<PdfOptions>){
2790
2790
super(init);
2791
2791
Object.assign(this,init);
2792
2792
}
2793
2793
}
2794
2794
2795
-
// tslint:disable:quotemark
2796
-
// tslint:disable-next-line:no-namespace
2797
-
exportnamespacePdfOptions{
2798
-
exportenumPermissionsEnum{
2799
-
AllowAll='AllowAll'asany,
2800
-
DenyPrinting='DenyPrinting'asany,
2801
-
DenyModification='DenyModification'asany,
2802
-
DenyDataExtraction='DenyDataExtraction'asany,
2803
-
DenyAll='DenyAll'asany,
2804
-
}
2805
-
}
2806
-
// tslint:enable:quotemark
2807
2795
/**
2808
2796
* Represents relatively positioned rectangle which contains single word
0 commit comments