Aspose.Slides  for Node.js via Java

Node.js PowerPoint API for Presentations

Create, read, modify, and convert PowerPoint and OpenDocument presentations using Node.js without requiring Microsoft PowerPoint for core presentation operations.

  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 requiring Microsoft PowerPoint for core presentation processing. Optional workflows such as video encoding and AI-powered translation use external tools or services. The library 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.
  • Generating frames and timing data for high-quality videos with animations and slide transitions; encoding the frames into MP4 requires an external tool such as FFmpeg.
  • 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.

            
const presentation = new aspose.slides.Presentation();
try {
    const 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:

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

try {
    const slideCount = presentation2.getSlides().size();
    for (let slideIndex = 0; slideIndex < slideCount; slideIndex++) {
        const slide = presentation2.getSlides().get_Item(slideIndex);
        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:

            
const presentation = new aspose.slides.Presentation();
try {
    const slides = presentation.getSlides();
    slides.removeAt(0);
    slides.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 PPT, PPTX, or OpenDocument Presentation (ODP) file to PDF using the default options.

            
const 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 PPT, PPTX, or OpenDocument Presentation (ODP) file into a set of JPEG images.

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

FAQ

  • What do I install, and does the machine need Java?
    npm install aspose.slides.via.java, and yes — it runs on Windows, Unix/Linux and macOS with JDK 1.8 or above installed.
  • Why does it list a JDK rather than a JRE?
    The package bridges Node.js to the Java build of Aspose.Slides, and the stated requirement is JDK 1.8 or above. Plan for a full JDK on the machine rather than a runtime-only Java install.
  • Which formats can Node.js export to with this build?
    PPT, PPTX, PPS, POT, PPSX, PPTM, PPSM, POTX, POTM and ODP are read and written; PDF, PDF/A, XPS, JPEG, PNG, BMP, TIFF, GIF, SVG and HTML are export targets.
  • Why do the calls look like `getSlides().get_Item(0)`?
    The API is the Java one exposed through the bridge, so it keeps Java naming. The via .NET build exposes a more JavaScript-shaped API if that matters to you.

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