|
1 | | -    [](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-node/blob/master/LICENSE) |
| 1 | +# GroupDocs.Conversion Cloud Node.js SDK |
2 | 2 |
|
3 | | -# Node.js SDK to Convert Documents in the Cloud |
| 3 | +Node.js module for communicating with the GroupDocs.Conversion Cloud API |
4 | 4 |
|
5 | | -[GroupDocs.Conversion Cloud SDK for Node.js](https://products.groupdocs.cloud/conversion/nodejs) wraps GroupDocs.Conversion RESTful APIs so you may integrate **Document Conversion** features in your own apps with zero initial cost. |
| 5 | +## Installation |
6 | 6 |
|
7 | | -GroupDocs.Conversion Cloud API allows the developers to convert between 50+ file formats including Word documents, Excel spreadsheets, PowerPoint presentations, PDF, OpenDocument files, images & more. |
| 7 | +A package `groupdocs-conversion-cloud` is available at [npmjs.com](https://www.npmjs.com/package/groupdocs-conversion-cloud). You can install it with: |
8 | 8 |
|
9 | | -## Document Conversion REST API |
| 9 | +```shell |
| 10 | +npm install groupdocs-conversion-cloud |
| 11 | +``` |
10 | 12 |
|
11 | | -- Convert the whole document to the desired target format. |
12 | | -- Convert specific document page(s) or a page range. |
13 | | -- Auto-detect source document format without requiring the file extension. |
14 | | -- Load source document with extended options, such as specify password for password-protected documents. |
15 | | -- Load specific part of the document. |
16 | | -- Show or hide document comments. |
17 | | -- Obtain all supported conversion formats list. |
18 | | -- Replace missing fonts with any other font. |
19 | | -- Add text or image watermarks to any page. |
20 | | -- Specify resolution and quality for resultant images. |
21 | | -- Extract metadata & basic information about the source document. |
22 | | -- Integrated storage API. |
| 13 | +## Getting Started |
23 | 14 |
|
24 | | -Check out the [Developer's Guide](https://docs.groupdocs.cloud/conversion/developer-guide/) to know more about GroupDocs.Conversion REST API. |
| 15 | +Please follow the [installation](#installation) procedure and then run the following JavaScript code: |
25 | 16 |
|
26 | | -## Microsoft File Formats |
| 17 | +```js |
| 18 | +// load the module |
| 19 | +var GroupDocs = require('groupdocs-conversion-cloud'); |
| 20 | + |
| 21 | +// get your appSid and appKey at https://dashboard.groupdocs.cloud (free registration is required). |
| 22 | +var appSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"; |
| 23 | +var appKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; |
| 24 | + |
| 25 | +// construct Api |
| 26 | +var api = GroupDocs.InfoApi.fromKeys(appSid, appKey); |
| 27 | +var request = new GroupDocs.GetSupportedConversionTypesRequest(); |
| 28 | +// retrieve supported conversion types |
| 29 | +api.getSupportedConversionTypes(request) |
| 30 | + .then(function (response) { |
| 31 | + console.log("Supported file-formats:") |
| 32 | + response.forEach(function (format) { |
| 33 | + console.log(format.sourceFormat + ": [" + format.targetFormats.join(", ") + "]"); |
| 34 | + }); |
| 35 | + }) |
| 36 | + .catch(function (error) { |
| 37 | + console.log("Error: " + error.message) |
| 38 | + }); |
| 39 | +``` |
27 | 40 |
|
28 | | -**Microsoft Word:** DOC, DOCM, DOCX, DOT, DOTM, DOTX\ |
29 | | -**Microsoft Excel:** XLS, XLSX, XLSB, XLSM\ |
30 | | -**Microsoft PowerPoint:** PPT, PPTX, PPS, PPSX\ |
31 | | -**Microsoft Project:** MPP, MPT\ |
32 | | -**Microsoft Outlook:** MSG, EML\ |
33 | | -**Microsoft Visio:** VSD, VDX, VSS, VSX, VST, VTX, VSDX, VDW, VSSX, VSTX, VSDM, VSTM, VSSM\ |
34 | | -**Microsoft OneNote:** ONE |
| 41 | +Or compile and run same written in TypeScript: |
35 | 42 |
|
36 | | -## Other Formats |
| 43 | +```ts |
| 44 | +// load the module |
| 45 | +import { INfoApi, GetSupportedConversionTypesRequest } from "groupdocs-conversion-cloud"; |
37 | 46 |
|
38 | | -**Page Layout Formats:** PDF, XPS\ |
39 | | -**OpenDocument:** ODT, OTT, ODS, ODP, OTP, OTS, ODG\ |
40 | | -**CAD:** DXF, DWG, IFC, STL\ |
41 | | -**Images:** DCM, BMP, GIF, JPG, PNG, TIFF, WebP, DjVu, SVG, DNG, ICO\ |
42 | | -**Web:** HTML, MHT, MHTML\ |
43 | | -**Emails:** EML, EMLX\ |
44 | | -**eBooks:** EPUB, MOBI\ |
45 | | -**Metafile:** WMF, EMF\ |
46 | | -**LaTeX:** TEX\ |
47 | | -**Others:** TXT, RTF, CSV, TSV, XML |
| 47 | +// get your appSid and appKey at https://dashboard.groupdocs.cloud (free registration is required). |
| 48 | +const appSid: string = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"; |
| 49 | +const appKey: string = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; |
48 | 50 |
|
49 | | -## Get Started with GroupDocs.Conversion Cloud SDK for Node.js |
| 51 | +// construct Api |
| 52 | +const api: InfoApi = InfoApi.fromKeys(appSid, appKey); |
50 | 53 |
|
51 | | -First create an account at [GroupDocs for Cloud](https://dashboard.groupdocs.cloud/) and get your application information. Next, execute the following command to get the package from npmjs.com. |
| 54 | +const request: GetSupportedConversionTypesRequest = new GetSupportedConversionTypesRequest(); |
52 | 55 |
|
53 | | -```shell |
54 | | -npm install groupdocs-conversion-cloud |
| 56 | +// retrieve supported file-formats |
| 57 | +api.getSupportedConversionTypes(request) |
| 58 | + .then((result) => { |
| 59 | + console.log("Supported file-formats:"); |
| 60 | + result.forEach((format) => { |
| 61 | + console.log(format.sourceFormat + ": [" + format.targetFormats.join(", ") + "]"); |
| 62 | + }); |
| 63 | + }) |
| 64 | + .catch((error) => { |
| 65 | + console.log("Error: " + error.message); |
| 66 | + }); |
55 | 67 | ``` |
56 | 68 |
|
57 | | -## Convert DOCX to PDF in the Cloud |
| 69 | +## Licensing |
58 | 70 |
|
59 | | -```js |
60 | | -// Get your application information from https://dashboard.groupdocs.cloud |
61 | | -global.conversion_cloud = require("groupdocs-conversion-cloud"); |
62 | | - |
63 | | -// Get Client Id and Client Secret from https://dashboard.groupdocs.cloud |
64 | | -const myClientId: string = ""; |
65 | | -const myClientSecret: string = ""; |
66 | | - |
67 | | -// Create instance of the API |
68 | | -const configuration: Configuration = conversion_cloud.Configuration(myClientId, myClientSecret); |
69 | | -const convertApi: ConvertApi = conversion_cloud.ConvertApi.fromConfig(configuration); |
70 | | - |
71 | | -let settings = new conversion_cloud.ConvertSettings(); |
72 | | -settings.filePath = "WordProcessing/four-pages.docx"; |
73 | | -settings.format = "pdf"; |
74 | | -settings.outputPath = "converted"; |
75 | | - |
76 | | -let result = await convertApi.convertDocument(new conversion_cloud.ConvertDocumentRequest(settings)); |
77 | | -``` |
| 71 | +GroupDocs.Conversion Cloud Node.js SDK licensed under [MIT License](LICENSE). |
78 | 72 |
|
79 | | -## GroupDocs.Conversion Cloud SDKs in Popular Languages |
| 73 | +## Resources |
| 74 | ++[**Website**](https://www.groupdocs.cloud) |
| 75 | ++[**Product Home**](https://products.groupdocs.cloud/conversion) |
| 76 | ++[**Documentation**](https://docs.groupdocs.cloud/conversion) |
| 77 | ++[**Free Support Forum**](https://forum.groupdocs.cloud/c/conversion) |
| 78 | ++[**Blog**](https://blog.groupdocs.cloud/category/conversion) |
80 | 79 |
|
81 | | -| .NET | Java | PHP | Python | Ruby | Node.js | Android | |
82 | | -|---|---|---|---|---|---|---| |
83 | | -| [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-dotnet) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-java) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-php) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-python) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-ruby) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-node) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-android) | |
84 | | -| [NuGet](https://www.nuget.org/packages/GroupDocs.Conversion-Cloud/) | [Maven](https://repository.groupdocs.cloud/webapp/#/artifacts/browse/tree/General/repo/com/groupdocs/groupdocs-conversion-cloud) | [Composer](https://packagist.org/packages/groupdocscloud/groupdocs-conversion-cloud) | [PIP](https://pypi.org/project/groupdocs-conversion-cloud/) | [GEM](https://rubygems.org/gems/groupdocs_conversion_cloud) | [NPM](https://www.npmjs.com/package/groupdocs-conversion-cloud) | | |
| 80 | +## Contact Us |
85 | 81 |
|
86 | | -[Home](https://www.groupdocs.cloud/) | [Product Page](https://products.groupdocs.cloud/conversion/nodejs) | [Documentation](https://docs.groupdocs.cloud/conversion/) | [Live Demo](https://products.groupdocs.app/conversion/total) | [API Reference](https://apireference.groupdocs.cloud/conversion/) | [Code Samples](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-node-samples) | [Blog](https://blog.groupdocs.cloud/category/conversion/) | [Free Support](https://forum.groupdocs.cloud/c/conversion) | [Free Trial](https://dashboard.groupdocs.cloud) |
| 82 | +Your feedback is very important to us. Please feel free to contact us using our [Support Forums](https://forum.groupdocs.cloud/c/conversion). |
0 commit comments