- Introduction
- Features
- Live Demo
- Installation
- Documentation
- Issues / Suggestions
- Need Help?
- Contributors
- License
This library creates Open Office XML (OOXML) Presentations which are compatible with Microsoft PowerPoint, Apple Keynote, and other applications.
Extensive browser support
- Create/download presentations on all current desktop & mobile web browsers
- IE11 is supported via included Promises polyfill
Major PowerPoint object types
- Slides can include Charts, Images, Media, Shapes, Tables, Text and more.
- SVG images and YouTube videos are supported when viewed in PowerPoint online/2019+ desktop application
Modern architecture
- Supports client web browsers, NodeJS, and React/Angular/Electron
- Export methods return promises
- Client browsers have only a single dependency: JSZip
- Easy Angular/React integration (available via npm, cjs or es files)
- Typescript definitions included
HTML to PowerPoint
- Includes powerful HTML-to-PowerPoint feature to transform HTML tables into presentations with a single line of code
Use the online demo to create a simple presentation to see how easy it is to use pptxgenjs, or check out the complete demo which showcases every available feature.
<!-- 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/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/dist/pptxgen.bundle.js"></script>
<!-- Individual files: Add only what's needed to avoid clobbering loaded libraries -->
<script src="PptxGenJS/libs/jszip.min.js"></script>
<script src="PptxGenJS/dist/pptxgen.min.js"></script>
<!-- <script src="PptxGenJS/libs/promise.min.js"></script> IE11 requires Promises polyfill -->
npm install pptxgenjs --save
let PptxGenJS = require("pptxgenjs");
let pptx = new PptxGenJS();
yarn add pptxgenjs
- CommonJS:
dist/pptxgen.cjs.js
- ES Module:
dist/pptxgen.es.js
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
let pptx = new PptxGenJS();
let slide = pptx.addSlide();
let textboxText = "Hello World from PptxGenJS!";
let textboxOpts = { x: 1, y: 1, align: "center", color: "363636", fill: "f1f1f1" };
slide.addText(textboxText, textboxOpts);
pptx.writeFile("Sample Presentation");
That's really all there is to it!
Full documentation and code examples are available
- Creating a Presentation
- Presentation Options
- Adding a Slide
- Slide Options
- Saving a Presentation
- Master Slides
- Adding Charts
- Adding Images
- Adding Media
- Adding Shapes
- Adding Tables
- Adding Text
- Speaker Notes
- Using Scheme Colors
- Creating a Presentation
- Integration with Other Libraries
Easily convert HTML tables to PowerPoint presentations in a single call.
let pptx = new PptxGenJS();
pptx.tableToSlides("tableElementId");
pptx.writeFile("HTML2PPT.pptx");
Learn more:
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 code in the demos
directory. There
are demos for both client browsers, node and react that contain working examples of every available library feature.
- Use a pre-configured jsFiddle to test with: PptxGenJS Fiddle
- View questions tagged
PptxGenJS
on StackOverflow. If you can't find your question, ask it yourself - be sure to tag itPptxGenJS
.
Thank you to everyone for the issues, contributions and suggestions! ❤️
Special Thanks:
- Dzmitry Dulko - Getting the project published on NPM
- Michal Kacerovský - New Master Slide Layouts and Chart expertise
- Connor Bowman - Adding Placeholders
- Reima Frgos - Multiple chart and general functionality patches
- Matt King - Chart expertise
- Mike Wilcox - Chart expertise
PowerPoint shape definitions and some XML code via Officegen Project
Copyright © 2015-2020 Brent Ely