Node.js Library for PowerPoint File Formats
Aspose.Slides for Node.js via .NET is a PowerPoint API for presentations manipulation and management. It allows developers to read, write, convert and manipulate PowerPoint presentations using Node.js. All document elements such as slides, tables, text, charts, shapes, images and SmartArt diagrams are accessible for manipulation, supports exporting presentations to PDF, PDF/A, HTML, XPS and image formats. The PowerPoint API includes many extended PPT and PPTX features as: merge, clone, split, compare presentations.
Node.js PowerPoint Library Features
- Create or clone existing slides from templates.
- Save & open files to & from streams.
- Generate presentations from database.
- Create shapes and add text to shapes on slides.
- Work with PowerPoint tables.
- Handle text & shape formatting.
- Remove or apply the protection on shapes.
- Embed Excel charts as OLE objects in slides.
- Work with ActiveX component.
Read & Write PowerPoint Files
Microsoft PowerPoint: PPT, PPTX, PPS, POT, PPSX, PPTM, PPSM, POTX, POTM
OpenOffice: ODP, ODS
Text: CSV, Tab-Delimited, TXT, JSON
Web: HTML, MHTML
Save PowerPoint Files As
Fixed Layout: PDF, XPS
Images: JPEG, PNG, BMP, SVG, TIFF, GIF, EMF
Text: CSV, Tab-Delimited, JSON, SQL, XML
Web: HTML
Getting Started with Aspose.Slides for Node.js via .NET
Aspose.Slides for Node.js via .NET is a javascript wrapper that works with the .NET6 or above runtime.
Prerequisites
- .NET6 or above.
- https://www.npmjs.com/package/edge-js
- https://www.npmjs.com/package/mocha (for unit tests)
- Node.js
Installation
From the command line:
npm install aspose.slides.via.net
Please use the following article for details.
Create New PowerPoint Presentation using Node.js
const asposeSlides = require('aspose.slides.via.net');
const { Presentation, SaveFormat, PdfOptions } = asposeSlides;
const fs = require('fs');
if (!fs.existsSync("out")) fs.mkdirSync("out");
function createEmptyPresentation() {
var emptyPresentation = new Presentation();
emptyPresentation.save("out/emptyPresentation.pptx", SaveFormat.Pptx);
emptyPresentation.dispose();
}
createEmptyPresentation();
Add/Remove Slides and Edit Shape Properties in Node.js
const asposeSlides = require('aspose.slides.via.net');
const {
Presentation,
BackgroundType,
FillType,
ImageFormat
} = asposeSlides;
const fs = require('fs');
function manipulatePresentation() {
var pres = new Presentation();
pres.slides.addEmptySlide(pres.layoutSlides.get(0));
var pres2 = new Presentation();
pres.slides.addClone(pres2.slides.get(0));
console.log("countSlides:" + pres.slides.count);
pres.slides.removeAt(0);
console.log("countSlides:" + pres.slides.count);
var slide = pres.slides.get(0);
var slideNumber = slide.slideNumber;
var hidden = slide.hidden;
slide.background.type = BackgroundType.OwnBackground;
slide.background.fillFormat.fillType = FillType.Solid;
slide.background.fillFormat.solidFillColor.color = "#AEC025F4";
console.log("backgroundType:" + slide.background.type);
console.log("backgroundColor:" + slide.background.fillFormat.solidFillColor.color);
if (!fs.existsSync("out")) fs.mkdirSync("out");
var slideThumbnail = slide.getThumbnailWithImageSize({width: 960, height: 720});
slideThumbnail.save("out/slide-thumbnail.png", ImageFormat.Png);
pres.save("out/slides-manipulation.pptx", asposeSlides.SaveFormat.Pptx);
pres.dispose();
pres2.dispose();
}
Product Page | Documentation | API Reference | Code Examples | Blog | Free Support | Temporary License