Quickly and easily create PowerPoint presentations with a few simple JavaScript commands in client web browsers or Node desktop apps.
- Widely Supported: Creates and downloads presentations on all current web browsers (Chrome, Edge, Firefox, etc.) and IE11
- Full Featured: Slides can include Charts, Images, Media, Shapes, Tables and Text (plus Master Slides/Templates)
- Easy To Use: Entire PowerPoint presentations can be created in a few lines of code
- Modern: Pure JavaScript solution - everything necessary to create PowerPoint PPT exports is included
- Use the unique HTML-to-PowerPoint feature to copy an HTML table into 1 or more Slides with a single command
Table of Contents (generated with DocToc)
- Live Demo
- Quick Start Guide
- Library API
- HTML-to-PowerPoint Feature
- Integration with Other Libraries
- Full PowerPoint Shape Library
- Typescript Definitions
- Issues / Suggestions
- Need Help?
- Unimplemented Features
- Special Thanks
- Support Us
- License
Use JavaScript to create a PowerPoint presentation with your web browser right now:
https://gitbrent.github.io/PptxGenJS
<!-- Bundle: Easiest to use, supports all browsers -->
<script src="https://cdn.jsdelivr.net/gh/gitbrent/[email protected]/dist/pptxgen.bundle.js"></script>
<!-- Individual files: Add only what's needed to avoid clobbering loaded libraries -->
<script src="https://cdn.jsdelivr.net/gh/gitbrent/[email protected]/libs/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/gitbrent/[email protected]/libs/jszip.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/gitbrent/[email protected]/dist/pptxgen.min.js"></script>
<!-- Bundle: Easiest to use, supports all browsers -->
<script src="PptxGenJS/libs/pptxgen.bundle.js"></script>
<!-- Individual files: Add only what's needed to avoid clobbering loaded libraries -->
<script src="PptxGenJS/libs/jquery.min.js"></script>
<script src="PptxGenJS/libs/jszip.min.js"></script>
<script src="PptxGenJS/dist/pptxgen.min.js"></script>
<!-- IE11 requires Promises polyfill -->
<!-- <script src="PptxGenJS/libs/promise.min.js"></script> -->
npm install pptxgenjs
var pptx = require("pptxgenjs");
yarn install pptxgenjs
PptxGenJS PowerPoint presentations are created via JavaScript by following 4 basic steps:
- Create a new Presentation
- Add a Slide
- Add one or more objects (Tables, Shapes, Images, Text and Media) to the Slide
- Save the Presentation
var pptx = new PptxGenJS();
var slide = pptx.addNewSlide();
slide.addText('Hello World!', { x:1.5, y:1.5, fontSize:18, color:'363636' });
pptx.save('Sample Presentation');
That's really all there is to it!
Creating a Presentation
Presentation Options
Integration with Other Libraries
If you are planning on creating Shapes (basically anything other than Text, Tables or Rectangles), then you'll want to
include the pptxgen.shapes.js
library.
The shapes file contains a complete PowerPoint Shape object array thanks to the officegen project.
<script src="PptxGenJS/dist/pptxgen.shapes.js"></script>
As of version 2.3.0, typescript definitions are available (pptxgen.d.ts
).
Please file issues or suggestions on the issues page on github, or even better, submit a pull request. Feedback is always welcome!
When reporting issues, please include a code snippet or a link demonstrating the problem. Here is a small jsFiddle that is already configured and uses the latest PptxGenJS code.
Sometimes implementing a new library can be a difficult task and the slightest mistake will keep something from working. We've all been there!
If you are having issues getting a presentation to generate, check out the demos in the examples
directory. There
are demos for both Nodejs and client-browsers that contain working examples of every available library feature.
- Use a pre-configured jsFiddle to test with: PptxGenJS Fiddle
- Use Ask Question on StackOverflow - be sure to tag it with "PptxGenJS"
The PptxGenJS library is not designed to replicate all the functionality of PowerPoint, meaning several features are not on the development roadmap.
These include:
- Animations
- Importing Existing Presentations and/or Templates
- Outlines
- SmartArt
- Officegen Project - Shape definitions and XML code
- Dzmitry Dulko - Getting the project published on NPM
- kajda90 - New Master Slide Layouts
- Connor Bowman - Adding Placeholders
- Reima Frgos - Multiple chart and general functionality patches
- PPTX Chart Experts: kajda90, Matt King, Mike Wilcox
- Everyone who has contributed, submitted an Issue, or created Pull Request.
Do you like this library and find it useful? Tell the world about us! PptxGenJS project
Thanks to everyone who supports this project! ❤
Copyright © 2015-2019 Brent Ely