Turn AI-generated HTML/CSS into native, editable PowerPoint slides.
npm install llm-dom-to-pptxllm-dom-to-pptx is a lightweight JavaScript library designed to bridge the gap between LLM-generated web designs (HTML/CSS) and Office productivity tools. Unlike screenshot-based tools, this library parses the DOM to create fully editable shapes, text blocks, and tables in PowerPoint.
html
`
🎯 Usage
$3
`javascript
// Export by element ID
await LLMDomToPptx.export('slide-canvas', { fileName: 'presentation.pptx' });
`
$3
`javascript
// Export all matching elements as separate slides
await LLMDomToPptx.export('.slide-page', { fileName: 'multi_slides.pptx' });
`
$3
You can add speaker notes to any slide using the data-speaker-notes attribute on the root container. Use \n for newlines.
`html
`
📐 HTML Structure
For best results, use a fixed-size container (960×540px for 16:9):
`html
`
🧠 System Prompt
This library works best with LLM-generated HTML that follows specific constraints. Use the included System_Prompt.md when instructing your LLM (GPT-4, Claude, etc.) to generate slides.
Key constraints:
- Root container: width: 960px; height: 540px
- Use absolute positioning for major sections
- Use Flexbox for internal layouts
- Stick to standard web fonts
📋 API Reference
$3
| Parameter | Type | Description |
|-----------|------|-------------|
| selector | string \| HTMLElement | Element ID, CSS selector, or DOM element |
| options.fileName | string | Output filename (default: presentation.pptx) |
| options.x | number | Horizontal offset in inches |
| options.y | number` | Vertical offset in inches |