Aspose.Slides  for Node.js via Java

Node.js PowerPoint API for Presentations

Create, Read, Modify, and Convert PowerPoint and OpenOffice presentations using Node.js without any external software.

Download Free Trial

Aspose.Slides for Node.js via Java is a powerful presentation processing library that allows Node.js developers to create, edit, convert, and manage PowerPoint presentations programmatically — without relying on Microsoft PowerPoint or any other third-party software. It supports all major presentation elements including slides, text, shapes, charts, tables, images, SmartArt, and multimedia.

Aspose.Slides for Node.js via Java provides these popular features:

  • Loading, opening, and viewing presentations.
  • Editing presentations.
  • Converting presentation files to popular presentation formats, such as PPT, PPTX, and ODP.
  • Exporting presentations to high-quality video (MP4) with full support for animations and slide transitions.
  • Exporting presentations to PDF, JPG, HTML, GIF, SVG, and many other formats.
  • Rendering and printing presentations.
  • Encrypting and decrypting presentations; password-protecting presentations and removing passwords.
  • Automatically translating presentations using AI-powered translation through integration with external language models.
  • Manipulating presentation entities, such as master slides, shapes, charts, picture frames, audio frames, video frames, OLE, VBA macros, animations, etc.
  • And many more features.

Node.js is a popular, free, open-source, cross-platform JavaScript runtime environment that lets developers write command-line tools and server-side scripts outside a browser. For this reason, the Aspose.Slides team is proud to offer Aspose.Slides for Node.js via Java to the Node.js community.

Advanced Node.js PowerPoint API Features

Create or clone existing slides from templates

Work with PowerPoint tables via API

Apply or remove the protection on shapes

Add Excel charts as OLE objects to slides

Create shapes and add text to shapes on slides

Handle text & shape formatting

Generate presentations from database

Protect presentations & resultant PDF

Print presentations on a physical printer

System Requirements

  • Aspose.Slides for Node.js via Java is a server-side JavaScript API based on Node.js. It can run on Windows, Unix/Linux, and macOS platforms with JDK 1.8 or above.

How to Install

Use npm to install the Aspose.Slides package for presentation processing from the npm package repository:

npm install aspose.slides.via.java

How to Create a New PowerPoint Presentation in Node.js

The example below adds a rectangle to the first slide of a presentation.

            
var aspose = aspose || {};

aspose.slides = require("aspose.slides.via.java");

let presentation = new aspose.slides.Presentation();
try {
    let slide = presentation.getSlides().get_Item(0);

    // Add a rectangle autoshape.
    slide.getShapes().addAutoShape(aspose.slides.ShapeType.Rectangle, 50, 150, 300, 200);

    presentation.save("output_presentation.pptx", aspose.slides.SaveFormat.Pptx);
}
finally {
    presentation.dispose();
}
            
        

How to Merge Presentations in Node.js

This Node.js code shows you how to merge presentations:

            
var aspose = aspose || {};

aspose.slides = require("aspose.slides.via.java");

let presentation1 = new aspose.slides.Presentation("presentation1.pptx");
let presentation2 = new aspose.slides.Presentation("presentation2.pptx");

try {
    for (let i = 0; i < presentation2.getSlides().size(); i++) {
        let slide = presentation2.getSlides().get_Item(i);
        presentation1.getSlides().addClone(slide);
    }
    presentation1.save("combined-presentation.pptx", aspose.slides.SaveFormat.Pptx);
}
finally {
    presentation1.dispose();
    presentation2.dispose();
}
            
        

How to Import a PDF as a Presentation in Node.js

This Node.js code demonstrates the PDF to PowerPoint conversion process. You can use this approach to convert PDF files to PPTX or ODP:

            
var aspose = aspose || {};

aspose.slides = require("aspose.slides.via.java");

let presentation = new aspose.slides.Presentation();
try {
    presentation.getSlides().removeAt(0);
    presentation.getSlides().addFromPdf("welcome-to-powerpoint.pdf");
    presentation.save("presentation.pptx", aspose.slides.SaveFormat.Pptx);
}
finally {
    presentation.dispose();
}
            
        

How to Convert PowerPoint to PDF in Node.js

This Node.js code shows how to convert a PowerPoint PPT, PPTX, or OpenOffice ODP document to PDF using the default options.

            
var aspose = aspose || {};

aspose.slides = require("aspose.slides.via.java");

let presentation = new aspose.slides.Presentation("presentation.ppt");
try {
    presentation.save("output.pdf", aspose.slides.SaveFormat.Pdf);
}
finally {
    presentation.dispose();
}
            
        

How to Convert PowerPoint to JPG in Node.js

The following example shows you how to convert a PowerPoint PPT, PPTX, or OpenOffice ODP document into a set of JPEG images.

            
var aspose = aspose || {};

aspose.slides = require("aspose.slides.via.java");

let presentation = new aspose.slides.Presentation("presentation.pptx");
try {
    for (let i = 0; i < presentation.getSlides().size(); i++) {
        let slide = presentation.getSlides().get_Item(i);
        let image = slide.getImage(1, 1);
        try {
            image.save("slide_" + i + ".jpg", aspose.slides.ImageFormat.Jpeg);
        }
        finally {
            image.dispose();
        }
    }
}
finally {
    presentation.dispose();
}
            
        

What People Are Saying

Don't just take our word for it. See what users have to say about PowerPoint APIs.

View Case Studies

Support and Learning Resources