For AI agents: the complete documentation index is available at /pptxgenjs-plus/llms.txt, the full documentation bundle is available at /pptxgenjs-plus/llms-full.txt, and this page is available as Markdown at /pptxgenjs-plus/introduction.md.

Introduction

pptxgenjs generates PowerPoint (.pptx) files from JavaScript — in Node, the browser, and every common framework. This is pptxgenjs-plus: a modern, typed build shaped by community contributions.

If you are migrating from the original pptxgenjs package, see the Migration guide — it is a drop-in replacement.

How the API works

The library is built on a small object model with three levels:

Presentation                 new pptxgen()
└── Slide                    pres.addSlide()
    ├── Text                 slide.addText(...)
    ├── Table                slide.addTable(...)
    ├── Shape                slide.addShape(...)
    ├── Image                slide.addImage(...)
    ├── Chart                slide.addChart(...)
    └── Media                slide.addMedia(...)
  1. Create a Presentation — new pptxgen(). This is the document.
  2. Add Slides — pres.addSlide() returns a Slide you add content to.
  3. Add objects to a Slide — every object is one slide.addX(...) call that takes the content plus an options object. Options follow the same conventions everywhere: position and size are x, y, w, h in inches (or %), and colors are hex strings without # (e.g. "363636").
  4. Save — pres.writeFile() (Node/browser download) or pres.write(...) for a Blob/Buffer/base64/stream.

This is the complete API surface. The remaining documentation describes the options each addX method accepts.

Hello World

import pptxgen from "pptxgenjs-plus"

const pres = new pptxgen()
const slide = pres.addSlide()

slide.addText("Hello World from pptxgenjs!", { x: 1, y: 1, w: "80%", h: 1, fontSize: 24, color: "363636" })

await pres.writeFile({ fileName: "HelloWorld.pptx" })

Full TypeScript definitions ship with the package, so your editor autocompletes every method and option. The type definitions are the most complete reference available.

Where to go next

Output compatibility

Files are standards-compliant Open Office XML (OOXML) and open in Microsoft PowerPoint, Apple Keynote, LibreOffice Impress, and Google Slides (via import).

Issues and contributing

File issues or ideas on the issues page, or open a pull request. When reporting a problem, include a short code snippet that reproduces it. Documentation lives in-repo under docs/ — the "Edit this page" link on any page leads directly to its source file.

Contributors

This fork builds on the work of Brent Ely and the original pptxgenjs contributors:

PowerPoint shape definitions and some XML via the Officegen Project.

License

© 2026-present Matěj "lofcz" Štágl

MIT