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 Node.js library that lets you create, modify, and convert PowerPoint presentations in Node.js. It supports all presentation elements such as slides, shapes, text, charts, tables, images, and more. It also offers many advanced features such as merging, cloning, splitting, comparing, and printing presentations. It works without any dependencies and can process thousands of presentations in a short time.

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 PDF, JPG, HTML, GIF, SVG, and many other formats.
  • Rendering and printing presentations.
  • Encrypting and decrypting presentations; password-protecting presentations and removing passwords.
  • 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 and cross-platform JavaScript runtime environmentthat lets developers write command line tools and server-side scripts outside of 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 OleObjects 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 server-side JavaScript API based on Node.js. It can run on Windows, Unix/Linux & Mac platforms with JDK 1.8 or above.

How to Install

Use NPM to install our Node.js library for Presentation processing from the NPM Package repository:

npm install aspose.slides.via.java

How to Create New PowerPoint Presentation in Node.js

In the example given below, we have added a rectangle to the first slide of the presentation.

            	
var aspose = aspose || {};

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

var pres = new aspose.slides.Presentation();
try
{
    // Gets the first slide
    var slide = pres.getSlides().get_Item(0);
    // Adds an autoshape with type set to rectangle
    slide.getShapes().addAutoShape(aspose.slides.ShapeType.Rectangle, 50, 150, 300, 200);
    pres.save("outputPresentation.pptx", aspose.slides.SaveFormat.Pptx);
}
finally
{
    if (pres != null) pres.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");

var pres1 = new aspose.slides.Presentation("pres1.pptx");
var pres2 = new aspose.slides.Presentation("pres2.pptx");
try
{
    for (var i = 0; i < pres2.getSlides().size(); i++) 
    {
        pres1.getSlides().addClone(pres2.getSlides().get_Item(i));
    }
    pres1.save("combinedPresentation.pptx", aspose.slides.SaveFormat.Pptx);
}
finally
{
    if (pres1 != null) pres1.dispose();
    if (pres2 != null) pres2.dispose();
}
            
        

How to Import Presentation From PDF in Node.js. Convert PDF to PPT, Convert PDF to PPTX, Convert PDF to ODP

This Node.js code demonstrates the PDF to PowerPoint conversion process:

            
var aspose = aspose || {};

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

var pres = new aspose.slides.Presentation();
try
{
    pres.getSlides().removeAt(0);
    pres.getSlides().addFromPdf("welcome-to-powerpoint.pdf");
    pres.save("outputPresentation.pptx", aspose.slides.SaveFormat.Pptx);
}
finally
{
    if (pres != null) pres.dispose();
}
            
        

How to Convert PowerPoint to PDF in Node.js

This Node.js code shows you how to convert a PowerPoint PPT, PPTX, and OpenOffice ODP document to a PDF document using the default options. The resulting file is a PDF document at the maximum quality levels

            
var aspose = aspose || {};

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

// Instantiate a Presentation object that represents a PPT file
var pres = new aspose.slides.Presentation("PowerPoint.ppt");
try
{
    // Save the presentation as PDF
    pres.save("PPT-to-PDF.pdf", aspose.slides.SaveFormat.Pdf);
}
finally
{
    if (pres != null) pres.dispose();
}
            
        

How to Convert PowerPoint to JPG in Node.js. Convert PPT to JPG, Convert PPTX to JPG, Convert ODP to JPG

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

            
var aspose = aspose || {};
var java = require("java");

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

// Instantiate a Presentation object that represents a PPT file
var pres = new aspose.slides.Presentation("pres.pptx");
try
{
    for (var i = 0; i < pres.getSlides().size(); i++)
    {
        var bmp = pres.getSlides().get_Item(i).getThumbnail(1, 1);
        var imageio = java.newInstanceSync("javax.imageio.ImageIO");
        var file = java.newInstanceSync("java.io.File", "slide_" + i + ".jpg");
        imageio.write(bmp, "JPEG", file);
    }
}
finally
{
    if (pres != null) pres.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