Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

bulletpoints

sgenoud15MIT0.16.0TypeScript support: included

JavaScript PowerPoint Library

javascript-create-powerpoint, javascript-create-pptx, javascript-generate-pptx, javascript-powerpoint, javascript-powerpoint-charts, javascript-powerpoint-online, javascript-pptx, js-create-powerpoint, js-create-pptx, js-generate-powerpoint, js-generate-powerpoint-charts, js-powerpoint, js-powerpoint-pptx, js-powerpoint-library

readme

BulletPoints

This is a fork from PPTxGenJS

Documentation is for now kept from the fork.

PptxGenJS

JavaScript library that creates PowerPoint presentations

  • Creates presentations on all current web browsers and IE11
  • Slides can include Charts, Images, Media, Shapes, Tables and Text, etc.
  • Powerful HTML-to-PowerPoint feature to transform any HTML table into a presentation
  • Modern, pure JavaScript, promise-based library
  • Only a single dependency (JSZip)
  • Easy Angular/React integration (available via npm, cjs or es files)

Table of Contents


Demo

Use JavaScript to create a PowerPoint presentation with your web browser right now!

The complete library demo is also online.

Installation

CDN

<!-- Bundle: Easiest to use, supports all browsers -->
<script src="https://cdn.jsdelivr.net/gh/gitbrent/pptxgenjs@3.0.0/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/pptxgenjs@3.0.0/libs/jszip.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/gitbrent/pptxgenjs@3.0.0/dist/pptxgen.min.js"></script>

Download

GitHub Latest Release

<!-- 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/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

PptxGenJS NPM Home

npm install pptxgenjs --save
let PptxGenJS = require('pptxgenjs')
let pptx = new PptxGenJS()

Yarn

yarn add pptxgenjs

Additional Builds

  • CommonJS: dist/pptxgenjs.cjs.js
  • ES Module: dist/pptxgenjs.es.js

Documentation

Quick Start Guide

PptxGenJS PowerPoint presentations are created via JavaScript by following 4 basic steps:

  1. Create a new Presentation
  2. Add a Slide
  3. Add one or more objects (Tables, Shapes, Images, Text and Media) to the Slide
  4. Save the Presentation
var pptx = new PptxGenJS()
var slide = pptx.addSlide()
slide.addText('Hello World from PptxGenJS!', {
    x: 1,
    y: 1,
    w: '80%',
    h: 3,
    color: '363636',
    align: 'center',
    fill: 'f1f1f1'
})
pptx.writeFile('Sample Presentation')

That's really all there is to it!


Library API

Full documentation and code examples are available

Note: Typescript Definitions are included


HTML-to-PowerPoint Feature

Easily convert HTML tables to PowerPoint presentations in a single call.

var pptx = new PptxGenJS()
pptx.tableToSlides('tableId')
pptx.writeFile('HTML-table.pptx')

Learn more:


Issues / Suggestions

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.


Need Help?

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.


Unimplemented Features

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

Contributors ✨

Thank you to everyone for the issues, contributions and suggestions! ❤️

Special Thanks:

PowerPoint shape definitions and some XML code via Officegen Project


License

Copyright © 2019-2020 Steve Genoud Copyright © 2015-2019 Brent Ely

MIT

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

Coming In [3.1]:

  • Sections

[3.0.0] - 2019-11-31

Added

  • Ability to specify numbered list format #452 (mayvazyan)
  • New cat/val axis options: majorTickMark/minorTickMark #473 (RokasDie)
  • Ability to set start number "startAt" for a bullet list of type numbered #554 #555 (bj-mitchell)

    Changed

  • Fixed: Set proper MIME type for PPTX presentation #471 (StefanBrand)
  • Fixed: SVG images used to be generated by Node #515 (michaelcbrook)
  • Fixed: SVG support has several issues #528 (RicardoNiepel)
  • Fixed: Downloading PPT in iOS using Safari does not work. File named as UNKNOWN. #540 (mustafagentrit)
  • Fixed: Tables not being displayed after update #559 (emartz404)
  • Fixed: Hyperlink creates malformed slide if it includes "&" #562 (Tehnix)
  • Fixed: Exporting images corrupting file. #578 (joeberth)
  • Fixed: Multiple files getting downloaded if multiple base64 images are added. #581 (akshaymagapu)
  • Fixed: Links in tables won't work on tables generated with autoPage #583 (githuis)

    Removed

  • Removed: jQuery is no longer required (!)

[2.6.0] - 2019-09-24

Added

  • Host the Examples demo webpage online #505 (multiplegeorges)
  • Add types key to package.json #529 (adamlong5)
  • Add support for font family css when export HTML table to slide. #571 (Jank1310)

    Changed

  • Fixed: MIME type is ppt now instead of "application/zip"
  • Fixed: Not Able to add background image from the www source #497 (nish25sp)
  • Fixed: Set proper MIME type for PPTX presentation #471 (StefanBrand)
  • Fixed: lineDash Option is not in documentation #526 (Jank1310)
  • Fixed: Downloading PPT in iOS using Safari does not work. File named as UNKNOWN. #540 (mustafagentrit)
  • Fixed: ReferenceError: strXmlBullet is not defined #587 (Saurabh-Chandil)
  • Fixed: Getting paraPropXmlCore not defined error - line 4200 in pptxgen.bundle.js missing "var" declaration #596 (rajeearyal)

    Removed

[2.5.0] - 2019-02-08

Added

  • Make Shapes available for a front-end usage #137 (spamforhope)
  • Ability to rotate chart axis labels (catAxisLabelRotate/valAxisLabelRotate) #378 (teejayvanslyke)
  • New Chart Type: 3D bar charts #384 (loictro)
  • New Chart Feature: Add Data Labels to Scatter Charts #420 (ReimaFrgos)
  • Add new chart options: catAxisLabelFontBold,dataLabelFontBold,legendFontFace,valAxisLabelFontBold #426 (BandaSatish07)
  • Add missing jpg content type to fix corrupt presentation for Office365 #435 (antonandreyev)
  • Add catAxisMinVal and catAxisMaxVal #462 (vrimar)
  • New Chart Option: valAxisCrossesAt #474 (ReimaFrgos)
  • Docs: Show how to save as Blob using client browser #478 (crazyx13th)

    Changed

  • Fixed: Dynamic Text Options do not apply #427 (sunnyar)
  • Removed: legacy/deprecated attributes from README javascript script tags #431 (efx)
  • Fixed: issue with SlideNumber fontSize float values #432 (efx)
  • Fixed: query and fragment from image URL extension #433 (katsuya-horiuchi)
  • Changed: Replace "$" with "jQuery" to fix integration issues with some applications #436 (antonandreyev)
  • Changed: Export more types to enhance TypeScript support #443 (ntietz)
  • Fixed: Rounding in percentage leads to small deviations #470 (Slidemagic) #475 (ReimaFrgos)
  • Fixed: Hyperlinks causing duplicate relationship ID when other objects on page #477 (ReimaFrgos)
  • Fixed: ordering of paragraph properties #485 (sleepylemur)

    Removed

[2.4.0] - 2018-10-28

Added

v2.3.0 (2018-09-12)

Full Changelog

Highlights:

  • New Feature: Placeholders
  • New Feature: Speaker Notes
  • addImage() can now load both local ("../img.png") and remote images ("https://wikimedia.org/logo.jpg")
  • Typescript definitions are now available
  • jquery-node replaced with latest jquery package [only affects npm users]

Fixed Bugs:

Implemented Enhancements:

  • addImage() updated with new code allowing both local and remote images to be used (browser and Node). (gitbrent)
  • Typescript definitions have been created for the PptxGenJS API Methods (pptxgen.d.ts). (gitbrent)
  • New Feature: Placeholder support in Master Slides #359 (conbow)
  • New Feature: Speaker Notes #239 #361 (travispwingo)
  • New Chart Option: displayBlanksAs #365 (guipas)
  • New Feature: ability to hide slides #367 (ReimaFrgos)
  • Add second Cat Axis for Scatter and Bubble #372 (KrishnaTejaReddyV)
  • New Chart Type: Add radar chart implementation #386 (loictro)

v2.2.0 (2018-06-17)

Full Changelog

Fixed Bugs:

Implemented Enhancements:

  • New Feature! addImage() and addMedia() methods now accept URLs #325 (gitbrent)
  • Make Node detection more robust #277 (adrianirwin) (DSheffield)
  • Updated pptxgenjs-demo files to use CDNs instead of local files (gitbrent)
  • Updated Node.js detection to increase reliability for Angular users et al. (gitbrent)
  • Add w and h attributes to slideNumber() #336 (s7726)

v2.1.0 (2018-04-02)

Full Changelog

Fixed Bugs:

  • HTML-to-PowerPoint is creating many extra columns with colspan #284 (svaak)
  • HTML-to-PowerPoint rowspan is not working (gitbrent)
  • Fix docs/examples to use new fontSize, remove unsupported font_size #297 (pstoll)

Implemented Enhancements:

v2.0.0 (2018-01-23)

Full Changelog

BREAKING CHANGES

  • NodeJS instantiation is now standard (see Issue #83 and examples/nodejs-demo.js) which now allows new instances/presentations
  • (See "Version 2.0 Breaking Changes" in the README for a complete list)

Fixed Bugs:

  • Master Slide slide number doesn't show using "New Slide" PPT Function #229 (ineran)
  • Values of 0 (zero) in series are missing in line chart #240 (andrei-cs)
  • Node: "DeprecationWarning: Calling an asynchronous function without callback is deprecated." #252 (the-yadu)
  • The UP_DOWN_ARROW shape appears to have duplicate keys #253 (heavysixer)
  • Local demo can not run in IE #273 (IvanTao)

Implemented Enhancements:

v1.10.0 (2017-11-14)

Full Changelog

Fixed Bugs:

  • Fixed bug that was preventing 'chartColorsOpacity' from being anything other than 50 percent. (gitbrent)
  • The newPageStartY option is not being honored by addSlidesForTable() #222 (shaunvdp)
  • Line chart with one series displays broken #225 (andrei-cs)
  • The *AxisLineShow chart options do not work #231 (mconlin)

Implemented Enhancements:

v1.9.0 (2017-10-10)

Full Changelog

Fixed Bugs:

  • Vertical align and line break bug since update #79 (mirkoint)
  • Save callback is not called by client-browser when there are images to encode #187 (Malangs)
  • Promise Dependency - TypeError: Promise.all is not a function #188 (bartolomeu)
  • Default text size in empty cells making row height too big #193 (mreilaender)
  • Fixed issue that included many extraneous tab characters in the table demo lorem-ipsum text (GitBrent)
  • Fix chart issue: Entities encoding #204 (clubajax)
  • Fix chart issue: val axis #205 (clubajax)
  • Fix chart issue: Line chart series colors were not being respected #206 (kyrrigle)
  • Discrepancy between docs and code regarding setting a slide's background #207 (msambarino)
  • Fix chart issue: bar color regression #210 (clubajax)

Implemented Enhancements:

v1.8.0 (2017-09-12)

Full Changelog

Fixed Bugs:

Implemented Enhancements:

v1.7.0 (2017-08-07)

Full Changelog

Fixed Bugs:

Implemented Enhancements:

  • Add charts to Masters/Templates #114 (yipiha)
  • Format text as a superscript in a table cell #120 (aranard)

v1.6.0 (2017-07-17)

Full Changelog

Fixed Bugs:

  • The width or the height must be an integer not a float #29 (badlee)

Implemented Enhancements:

v1.5.0 (2017-05-26)

Full Changelog

Fixed Bugs:

Implemented Enhancements:

  • Add ability to create charts #51 (alagarrk)
  • Added image type to shapes to allow images to be placed on top of shapes, added more properties to ppt document #53 (ericwgreene)
  • Add support for RTL (Right-to-Left) text for Arabic etc. #73 (vanekar)
  • Shape line Diagonal #75 (vanekar)
  • Add hyperlink to Image #77 (plopez7)
  • Adding rounding radius for texts and shapes and dash options for the outline #86 (ivolazy)

v1.4.0 (2017-04-10)

Full Changelog

Fixed Bugs:

  • Auto Paging does not include master template on additional slides #61 (tb23911)
  • Issue calculating the available height for a table using Auto paging #64 (tb23911)
  • Multiple a:bodyPr tags within a:txBody causes damaged presentation in PowerPoint 2007 #69 (ZouhaierSebri)
  • Text bug #71 (alexbai31)
  • Errors when using Webpack/Typescript #72 (Vivihung)

Implemented Enhancements:

  • Add Slide Number formatting options #68 (ZouhaierSebri)
  • Added new feature: Hyperlinks as a text option

v1.3.0 (2017-03-22)

Full Changelog

Fixed Bugs:

  • Added image type to shapes to allow images to be placed on top of shapes, added more properties to ppt document #53 (ericwgreene)
  • Table-to-Slides default for un-styled tables is black text on black bkgd #57 (orpitadutta)
  • Table Header and Auto Paging #62 (tb23911)

Implemented Enhancements:

  • Removed FileSaver.js as a required library (only JSZip and jQuery are required now)
  • Allow text multi-formatting in single table cells #24 (jenkinsns)
  • Set fixed width to column using addSlidesForTable() #42 (priyaraskar)
  • Enhance bullet feature: offer diff types of bullets and add numbering option #49 (gitbrent)
  • Add 4 new Presentation properties: author, company, revision, subject #53 (ericwgreene)
  • Moved to semver (semantic versioning)

v1.2.1 (2017-02-26)

Full Changelog

Fixed Bugs:

  • Fixed issue with using percentages with x,y,w,h in addTable()
  • Table formatting bug with rowspans and colspans #46 (itskun)

Implemented Enhancements:

  • Allow more than a single 'x' and/or 'y' table location during Table Paging #43 (jenkinsns)
  • Bullets do not work with text objects in addText() method #44 (ellisgl)
  • Table location and pagination #47 (itskun)
  • Meta: Improve auto-paging in 'addTable()' #48 (gitbrent)
  • Created a new common file (pptxgenjs-demo.js) to hold all demo code - now used by both the browser and the node demos.

v1.2.0 (2017-02-15)

Full Changelog

Implemented Enhancements:

Fixed Bugs:

  • Table formatting bug in addTable() #36 (itskun)

v1.1.6 (2017-01-19)

Full Changelog

Implemented Enhancements:

  • Support for animated GIFs in addImage() #22 (shashank2104)
  • Added new slideNumber option allowing x and y placement of slide number #25 (priyaraskar)

v1.1.5 (2017-01-17)

Full Changelog

Fixed Bugs:

v1.1.4 (2017-01-04)

Full Changelog

Fixed Bugs:

  • Table formatting options set to default on empty cells #20 (rikvdk)
  • Fixed issue with addTable() where passing "#" before hex value for color or fill option would generate an invalid slide

v1.1.3 (2016-12-28)

Full Changelog

Implemented Enhancements:

  • Add new options to addSlidesForTable() allowing for placement and size: x,y,w,h #18 (priyaraskar)

Fixed Bugs:

v1.1.2 (2016-12-16)

Full Changelog

Implemented Enhancements:

  • The Slide addTable() method was modified to reduce the options passed from 2 objects to a single one

Fixed Bugs:

  • The colW addTable() option is not working #15 (ninas880025)
  • Modified addSlidesForTable(): table selectors made more specific by selecting only direct children now (nested tables would cause excessive looping) #14 (forrahul123)
  • Fixed crash caused by calling addText without an options object

v1.1.1 (2016-12-08)

Full Changelog

Implemented Enhancements:

  • Major documentation update
  • Added instructions to pptxgenjs.masters.js file, plus more examples and code
  • Added sandbox/ad-hoc code area to demo page

Fixed Bugs:

  • Table with 7 columns generates an invalid pptx file #12 (rikvdk)

v1.1.0 (2016-11-22)

Full Changelog

Implemented Enhancements:

Fixed Bugs:

v1.0.1 (2016-09-03)

Full Changelog

Implemented enhancements:

  • Moved from cx and cy option keys to w and h
  • Adding ability to load data uri as images/Updating jszip library #2 (DzmitryDulko)
  • Publish library as npm package #3 (DzmitryDulko)

Fixed Bugs:

v1.0.0 (2016-03-29)

Initial Release