Aspose.Slides for Node.js via .NET

Aspose.Slides for Node.js via .NET

Aspose.Slides for Node.js via .NET is a library for creating, reading, editing and converting PowerPoint and OpenDocument presentations in Node.js applications, without Microsoft PowerPoint or Office Automation. It runs Aspose.Slides for .NET through the edge-js bridge, so its JavaScript API mirrors the .NET API, with camelCase member names.

It loads and saves PPT, PPTX, PPS, POT and ODP, including macro-enabled and template variants, and exports to PDF, XPS, HTML, TIFF, Markdown and images.



Your first presentation

You need Node.js 22 or 24 and the .NET SDK 8 or later; Linux also needs a few system packages. Installation lists them and the platforms that were tested. Create a project, add an override that tells npm which edge-js release to install, and install the package:

mkdir hello-slides
cd hello-slides
npm init -y
npm pkg set overrides.edge-js=26.1.0
npm install aspose.slides.via.net

Once per machine, restore the .NET packages that the library depends on. Save the deps.csproj file from Restore the .NET Dependencies in a deps folder inside the project folder, then run:

dotnet restore deps/deps.csproj

Save this code as hello.js in the project folder:

const asposeSlides = require("aspose.slides.via.net");
const { Presentation, ShapeType, SaveFormat } = asposeSlides;

// A new presentation contains one empty slide.
const presentation = new Presentation();
try {
    const slide = presentation.slides.get(0);

    // Position and size are in points (1/72 inch): x, y, width, height.
    const rectangle = slide.shapes.addAutoShape(ShapeType.Rectangle, 50, 50, 400, 100);
    rectangle.addTextFrame("Hello, World!");

    presentation.save("hello.pptx", SaveFormat.Pptx);
    console.log("Saved hello.pptx");
} finally {
    // Release the .NET object that backs the presentation.
    presentation.dispose();
}

Run it from the project folder:

node hello.js

The script prints Saved hello.pptx and saves hello.pptx with one slide holding a rectangle with the text. Without a license, the saved file carries an evaluation watermark — see Licensing. For more ways to create and fill a presentation, see Create a Presentation.