Aspose.Slides for Node.js via Java
Aspose.Slides for Node.js via Java is a library for creating, reading, editing and converting PowerPoint and OpenDocument presentations in Node.js applications, without Microsoft PowerPoint.
It loads and saves PPT, PPTX, PPS, POT and ODP, including macro-enabled and template variants, and exports to PDF, XPS, HTML, SVG, TIFF, Markdown and images.
Get Started
GETTING STARTED
EVALUATE
Build with Slides
COMMON TASKS
SLIDES WORKFLOWS
EXAMPLES
Reference & Support
REFERENCE
SUPPORT
Your first presentation
Besides Node.js 20 or later, the package needs a Java Development Kit (JDK), Python and a C++ build toolchain, because npm compiles its java bridge during installation. See Installation for the steps on each operating system. Then create a project and install the package from npm:
mkdir hello-slides
cd hello-slides
npm init -y
npm install aspose.slides.via.java
Save this code as hello.js in the project folder:
const asposeSlides = require("aspose.slides.via.java");
const presentation = new asposeSlides.Presentation();
try {
const slide = presentation.getSlides().get_Item(0);
const shape = slide.getShapes().addAutoShape(asposeSlides.ShapeType.Rectangle, 50, 50, 400, 100);
shape.getTextFrame().setText("Hello, Aspose.Slides!");
presentation.save("hello.pptx", asposeSlides.SaveFormat.Pptx);
} finally {
presentation.dispose();
}
// Aspose.Slides runs in a Java virtual machine that keeps Node.js running, so end the process explicitly.
process.exit(0);
Run it with node hello.js. The script saves hello.pptx with one slide holding a text box. Without a license, the saved file carries an evaluation watermark — see Licensing. For more ways to create and fill a presentation, see Create Presentations.