TrinetraLabs/Placebo_AI
0
1# PptxGenJS2 34 5678910 11## π Features12 13**PptxGenJS lets you generate professional PowerPoint presentations in JavaScript - directly from Node, React, Vite, Electron, or even the browser.**14The library outputs standards-compliant Open Office XML (OOXML) files compatible with:15 16- β
Microsoft PowerPoint17- β
Apple Keynote18- β
LibreOffice Impress19- β
Google Slides (via import)20 21Design custom slides, charts, images, tables, and templates programmatically - no PowerPoint install or license required.22 23### Works Everywhere24 25- Supports every major modern browser - desktop and mobile26- Seamlessly integrates with **Node.js**, **React**, **Angular**, **Vite**, and **Electron**27- Compatible with **PowerPoint**, **Keynote**, **LibreOffice**, and other OOXML apps28 29### Full-Featured30 31- Create all major slide objects: **text, tables, shapes, images, charts**, and more32- Define custom **Slide Masters** for consistent academic or corporate branding33- Supports **SVGs**, **animated GIFs**, **YouTube embeds**, **RTL text**, and **Asian fonts**34 35### Simple & Powerful36 37- Ridiculously easy to use - create a presentation in 4 lines of code38- Full **TypeScript definitions** for autocomplete and inline documentation39- Includes **75+ demo slides** covering every feature and usage pattern40 41### Export Your Way42 43- Instantly download `.pptx` files from the browser with proper MIME handling44- Export as **base64**, **Blob**, **Buffer**, or **Node stream**45- Supports compression and advanced output options for production use46 47### HTML to PowerPoint Magic48 49- Convert any HTML `<table>` to one or more slides with a single line of code β [Explore the HTML-to-PPTX feature](#html-to-powerpoint-magic)50 51## π Live Demos52 53Try PptxGenJS right in your browser - no setup required.54 55- [Basic Slide Demo](https://gitbrent.github.io/PptxGenJS/demos/) - Build a basic presentation in seconds56- [Full Feature Showcase](https://gitbrent.github.io/PptxGenJS/demo/browser/index.html) - Explore every available feature57 58> Perfect for testing compatibility or learning by example - all demos run 100% in the browser.59 60## π¦ Installation61 62Choose your preferred method to install **PptxGenJS**:63 64### Quick Install (Node-based)65 66```bash67npm install pptxgenjs68```69 70```bash71yarn add pptxgenjs72```73 74### CDN (Browser Usage)75 76Use the bundled or minified version via [jsDelivr](https://www.jsdelivr.com/package/gh/gitbrent/pptxgenjs):77 78```html79<script src="https://cdn.jsdelivr.net/gh/gitbrent/pptxgenjs/dist/pptxgen.bundle.js"></script>80```81 82> Includes the sole dependency (JSZip) in one file.83 84π Advanced: Separate Files, Direct Download85 86Download from GitHub: [Latest Release](https://github.com/gitbrent/PptxGenJS/releases/latest)87 88```html89<script src="PptxGenJS/libs/jszip.min.js"></script>90<script src="PptxGenJS/dist/pptxgen.min.js"></script>91```92 93## π Universal Compatibility94 95PptxGenJS works seamlessly in **modern web and Node environments**, thanks to dual ESM and CJS builds and zero runtime dependencies. Whether you're building a CLI tool, an Electron app, or a web-based presentation builder, the library adapts automatically to your stack.96 97### Supported Platforms98 99- **Node.js** β generate presentations in backend scripts, APIs, or CLI tools100- **React / Angular / Vite / Webpack** β just import and go, no config required101- **Electron** β build native apps with full filesystem access and PowerPoint output102- **Browser (Vanilla JS)** β embed in web apps with direct download support103- **Serverless / Edge Functions** β use in AWS Lambda, Vercel, Cloudflare Workers, etc.104 105> _Vite, Webpack, and modern bundlers automatically select the right build via the `exports` field in `package.json`._106 107### Builds Provided108 109- **CommonJS**: [`dist/pptxgen.cjs.js`](./dist/pptxgen.cjs.js)110- **ES Module**: [`dist/pptxgen.es.js`](./dist/pptxgen.es.js)111 112## π Documentation113 114### Quick Start Guide115 116PptxGenJS PowerPoint presentations are created via JavaScript by following 4 basic steps:117 118#### Angular/React, ES6, TypeScript119 120```typescript121import pptxgen from "pptxgenjs";122 123// 1. Create a new Presentation124let pres = new pptxgen();125 126// 2. Add a Slide127let slide = pres.addSlide();128 129// 3. Add one or more objects (Tables, Shapes, Images, Text and Media) to the Slide130let textboxText = "Hello World from PptxGenJS!";131let textboxOpts = { x: 1, y: 1, color: "363636" };132slide.addText(textboxText, textboxOpts);133 134// 4. Save the Presentation135pres.writeFile();136```137 138#### Script/Web Browser139 140```javascript141// 1. Create a new Presentation142let pres = new PptxGenJS();143 144// 2. Add a Slide145let slide = pres.addSlide();146 147// 3. Add one or more objects (Tables, Shapes, Images, Text and Media) to the Slide148let textboxText = "Hello World from PptxGenJS!";149let textboxOpts = { x: 1, y: 1, color: "363636" };150slide.addText(textboxText, textboxOpts);151 152// 4. Save the Presentation153pres.writeFile();154```155 156That's really all there is to it!157 158## π₯ HTML-to-PowerPoint Magic159 160Convert any HTML `<table>` into fully formatted PowerPoint slides - automatically and effortlessly.161 162```javascript163let pptx = new pptxgen();164pptx.tableToSlides("tableElementId");165pptx.writeFile({ fileName: "html2pptx-demo.pptx" });166```167 168Perfect for transforming:169 170- Dynamic dashboards and data reports171- Exportable grids in web apps172- Tabular content from CMS or BI tools173 174[View Full Docs & Live Demo](https://gitbrent.github.io/PptxGenJS/html2pptx/)175 176## π Full Documentation177 178Complete API reference, tutorials, and integration guides are available on the official docs site: [https://gitbrent.github.io/PptxGenJS](https://gitbrent.github.io/PptxGenJS)179 180## π οΈ Issues / Suggestions181 182Please file issues or suggestions on the [issues page on github](https://github.com/gitbrent/PptxGenJS/issues/new), or even better, [submit a pull request](https://github.com/gitbrent/PptxGenJS/pulls). Feedback is always welcome!183 184When reporting issues, please include a code snippet or a link demonstrating the problem.185Here is a small [jsFiddle](https://jsfiddle.net/gitbrent/L1uctxm0/) that is already configured and uses the latest PptxGenJS code.186 187## π Need Help?188 189Sometimes implementing a new library can be a difficult task and the slightest mistake will keep something from working. We've all been there!190 191If you are having issues getting a presentation to generate, check out the code in the `demos` directory. There192are demos for browser, node and, react that contain working examples of every available library feature.193 194- Use a pre-configured jsFiddle to test with: [PptxGenJS Fiddle](https://jsfiddle.net/gitbrent/L1uctxm0/)195- [View questions tagged `PptxGenJS` on StackOverflow](https://stackoverflow.com/questions/tagged/pptxgenjs?sort=votes&pageSize=50). If you can't find your question, [ask it yourself](https://stackoverflow.com/questions/ask?tags=PptxGenJS) - be sure to tag it `pptxgenjs`.196- Ask your AI pair programmer! All major LLMs have ingested the pptxgenjs library and have the ability to answer functionality questions and provide code.197 198## π Contributors199 200Thank you to everyone for the contributions and suggestions! β€οΈ201 202Special Thanks:203 204- [Dzmitry Dulko](https://github.com/DzmitryDulko) - Getting the project published on NPM205- [Michal KacerovskΓ½](https://github.com/kajda90) - New Master Slide Layouts and Chart expertise206- [Connor Bowman](https://github.com/conbow) - Adding Placeholders207- [Reima Frgos](https://github.com/ReimaFrgos) - Multiple chart and general functionality patches208- [Matt King](https://github.com/kyrrigle) - Chart expertise209- [Mike Wilcox](https://github.com/clubajax) - Chart expertise210- [Joonas](https://github.com/wyozi) - [react-pptx](https://github.com/wyozi/react-pptx)211 212PowerPoint shape definitions and some XML code via [Officegen Project](https://github.com/Ziv-Barber/officegen)213 214## π Support the Open Source Community215 216If you find this library useful, consider contributing to open-source projects, or sharing your knowledge on the open social web. Together, we can build free tools and resources that empower everyone.217 218[@gitbrent@fosstodon.org](https://fosstodon.org/@gitbrent)219 220## π License221 222Copyright © 2015-present [Brent Ely](https://github.com/gitbrent/)223 224[MIT](https://github.com/gitbrent/PptxGenJS/blob/master/LICENSE)225 