Installation
Contents
[
Hide
]
Aspose.Slides for Node.js via .NET is platform-independent API and can be used on any platform (Windows, Linux and MacOS) where Node.js
and edge-js
bridge are installed.
Install from NPM
You can easily install Aspose.Slides for Node.js via .NET from NPM through this command:
$ npm install aspose.slides.via.net
If you encounter any problem during the installation process, please refer to https://www.npmjs.com/package/edge-js.
Install from ZIP archive
To install and use Aspose.Slides for Node.js via .NET from a ZIP archive, follow these instructions instead:
Windows
- Install .NET6 or above.
- Install Node.js (https://nodejs.org/en/download/) and add node.exe to
PATH
. - Install edge-js.
$ mkdir aspose.slides.nodejs.net
$ cd aspose.slides.nodejs.net
$ npm install -g edge-js
- Download Aspose.Slides for Node.js via .NET and extract it to
aspose.slides.nodejs/node_modules/aspose.slides.via.net
. - Create a file named
hello.js
inaspose.slides.nodejs.net
folder using the following sample code:
// Import the Aspose.Slides module for PowerPoint file manipulation
const asposeSlides = require('aspose.slides.via.net');
// Add necessary classes from the asposeSlides
const { Presentation, SaveFormat, PdfOptions } = asposeSlides;
const fs = require('fs');
if (!fs.existsSync("out")) fs.mkdirSync("out");
// Create and save an empty presentation to demonstrate basic functionality
function createEmptyPresentation() {
// Initialize a new empty presentation
var emptyPresentation = new Presentation();
// Save the empty presentation in PPTX format
emptyPresentation.save("out/emptyPresentation.pptx", SaveFormat.Pptx);
// Release resources associated with the presentation
emptyPresentation.dispose();
}
createEmptyPresentation(); // Execute the function to create an empty presentation
- Now run
node hello.js
@command prompt to run it.
Linux
- Install .NET6 or above.
- Install Node.js (https://nodejs.org/en/download/) and add node.exe to
PATH
. - Install edge-js.
$ mkdir aspose.slides.nodejs.net
$ cd aspose.slides.nodejs.net
$ npm install edge-js
- Download Aspose.Slides for Node.js via Java and extract it to
aspose.slides.nodejs/node_modules/aspose.slides.via.net
. - Create a test file named
hello.js
using this sample code inaspose.slides.nodejs.net
folder:
// Import the Aspose.Slides module for PowerPoint file manipulation
const asposeSlides = require('aspose.slides.via.net');
// Add necessary classes from the asposeSlides
const { Presentation, SaveFormat, PdfOptions } = asposeSlides;
const fs = require('fs');
if (!fs.existsSync("out")) fs.mkdirSync("out");
// Create and save an empty presentation to demonstrate basic functionality
function createEmptyPresentation() {
// Initialize a new empty presentation
var emptyPresentation = new Presentation();
// Save the empty presentation in PPTX format
emptyPresentation.save("out/emptyPresentation.pptx", SaveFormat.Pptx);
// Release resources associated with the presentation
emptyPresentation.dispose();
}
createEmptyPresentation(); // Execute the function to create an empty presentation
- Now run
node hello.js
@command prompt to run it.
Mac
- Install .NET6 or above.
- Install Node.js (https://nodejs.org/en/download/) and add node.exe to
PATH
. - Install edge-js.
$ mkdir aspose.slides.nodejs.net
$ cd aspose.slides.nodejs.net
$ npm install edge-js
```javascript
// Import the Aspose.Slides module for PowerPoint file manipulation
const asposeSlides = require('aspose.slides.via.net');
// Add necessary classes from the asposeSlides
const { Presentation, SaveFormat, PdfOptions } = asposeSlides;
const fs = require('fs');
if (!fs.existsSync("out")) fs.mkdirSync("out");
// Create and save an empty presentation to demonstrate basic functionality
function createEmptyPresentation() {
// Initialize a new empty presentation
var emptyPresentation = new Presentation();
// Save the empty presentation in PPTX format
emptyPresentation.save("out/emptyPresentation.pptx", SaveFormat.Pptx);
// Release resources associated with the presentation
emptyPresentation.dispose();
}
createEmptyPresentation(); // Execute the function to create an empty presentation
- Now run
node hello.js
@command prompt to run it.