revent-pptxgen
v1.1.0
Published
Create JavaScript PowerPoint Presentations
Readme
Revent PPTXGen
Revent PPTXGen is a JavaScript library designed for generating PowerPoint presentations programmatically using the core features of PptxGenJS. It allows users to create dynamic PowerPoint .pptx files directly from their JavaScript code in both client-side and server-side environments.
This package is designed to enhance and streamline the creation of PowerPoint presentations with custom shapes, text, and other elements.
Features
- Create PowerPoint presentations programmatically in JavaScript
- Supports various slide layouts, text, images, and shapes
- Custom bundling for both client-side and server-side environments
- Easily extendable for your custom needs
Installation
You can install this package directly via npm:
npm install revent-pptxgenor yarn:
yarn add revent-pptxgenUsage
Here’s a quick example to get started with creating a PowerPoint presentation:
In JavaScript (Client-Side)
import PptxGenJS from 'revent-pptxgen';
const pptx = new PptxGenJS();
const slide = pptx.addSlide();
// Add Title
slide.addText('Hello Revent PPTXGen!', { x: 1, y: 1, fontSize: 24, color: '363636' });
// Add Image
slide.addImage({ path: 'https://example.com/image.png', x: 0.5, y: 1.5, w: 4, h: 3 });
// Generate and download PPTX
pptx.writeFile('sample-presentation.pptx');In Node.js (Server-Side)
const PptxGenJS = require('revent-pptgen');
const pptx = new PptxGenJS();
const slide = pptx.addSlide();
slide.addText('Server-side PPTX Generation', { x: 1, y: 1, fontSize: 32 });
// Save to file system
pptx.writeFile('server-side-presentation.pptx').then(() => {
console.log('Presentation created successfully!');
});Development Setup
If you want to work on this library or extend it, clone the repository and install the dependencies:
git clone https://github.com/ReventAI/revent-pptxgen.git
cd revent-pptxgen
npm installTo build the package:
npm run buildThis will generate the bundled files in the dist folder.
Gulp Tasks
We also use Gulp for additional build tasks like minification and bundling for demos. The key tasks are:
gulp build: Builds the core librarygulp min: Minifies the main bundlegulp bundle: Bundles all assets for the demogulp watch: Watches for changes and rebuilds
Original Library
Revent PPTXGen is built on top of the original PptxGenJS library by Brent Ely. It provides additional flexibility and use cases tailored to the needs of this project. If you're interested in the core features, feel free to check out the original repository.
License
This project is licensed under the MIT License - see the LICENSE file for details.
