@deckflow/html2deck
v0.7.2
Published
Convert HTML to PPTX or PNG presentations (Free / Licensed / Cloud)
Readme
HTML2Deck
Languages: English · 简体中文 · 繁體中文 · Français · Deutsch · Español · 日本語 · 한국어
Turn HTML into presentation-ready PPTX or PNG — from files, stdin, or URLs, directly from your terminal.
Build once in HTML, then use the same source across decks, visual assets, and automated presentation workflows.
Product modes
| Mode | How | Advanced features (font embed / native charts / SVG rebuild) |
| --- | --- | --- |
| auto (default) | Valid local .lic → same as license; otherwise free | Follows resolved mode |
| free | --mode free | Degraded locally (FA fonts only, SVG as image, charts as raster). Tips suggest --mode cloud for advanced features. |
| license | --mode license (requires valid .lic) | Full local engine (same capabilities as former html2pptx). |
| cloud | --mode cloud | Server-side enhancements via --embed-fonts, --rebuild-svg, --rebuild-chart. |
# Free local (default when no valid .lic)
html2deck deck.html -o deck.pptx --mode free
# Premium via Cloud
html2deck deck.html -o deck.pptx --mode cloud --embed-fonts --rebuild-svg --rebuild-chart
# Licensed local
html2deck deck.html -o deck.pptx --mode license -f
# or: html2deck deck.html -o deck.pptx --mode license --license ~/.deckflow/html2deck.lic -fBuilt for real workflows
HTML2Deck fits workflows where content already lives in HTML or can be generated by code:
- Agent-generated presentations — let coding agents author HTML and produce deliverable PPTX or PNG outputs.
- Recurring reports — turn dashboards, metrics, and templated pages into presentation assets from CI or scheduled jobs.
- Web-to-deck reuse — convert hosted pages or ordered HTML files without rebuilding every slide manually.
- Local and cloud execution — run locally with no API key, or use cloud mode for hosted workflows and cloud-only enhancements.
Quick Start
Run without installing:
npx -y @deckflow/html2deck@latest index.html -o deck.pptxInstallation
npm install -g @deckflow/html2deck
html2deck --versionConvert HTML
Convert a single HTML file (output defaults to the same path and base name):
html2deck index.html
# → index.pptxSpecify an output path:
html2deck index.html -o deck.pptxPipe HTML from stdin:
cat index.html | html2deck - -o deck.pptxConvert multiple HTML files in order:
html2deck page1.html page2.html page3.html -o deck.pptxConvert a hosted page:
html2deck https://example.com/deck.html -o deck.pptxOutput Formats
Output format is inferred from the -o extension:
| Format | Description |
| --- | --- |
| pptx | PowerPoint deck output (default) |
| png | PNG frame output |
html2deck index.html -o frames.pngExecution Modes
| Mode | Description |
| --- | --- |
| auto | Default. Valid local .lic → license; otherwise free |
| free | Force Free local (degraded advanced features; tips suggest --mode cloud) |
| license | Require a valid commercial .lic and run full local engine |
| cloud | Always run in the cloud (guest rate-limited; sign in for full access) |
html2deck index.html --mode free
html2deck index.html --mode license -o deck.pptx
html2deck index.html --mode cloud -o deck.pptxCloud / License Enhancements
These flags require --mode cloud or --mode license (Free rejects them with guidance):
| Flag | Description |
| --- | --- |
| --embed-fonts | Embed fonts into the output |
| --rebuild-svg | Rebuild SVG as editable shapes |
| --rebuild-chart | Rebuild JS charts as native PPT charts |
html2deck index.html \
-o deck.pptx \
--mode cloud \
--embed-fontsAuthentication & Config
Local conversion works without an API key. Cloud mode can start as a rate-limited guest; sign in or configure an API key when prompted or when you need authenticated access.
html2deck auth login
html2deck auth status
html2deck config set api-key <key>For CI, Docker, or agent environments, set the environment variable (takes precedence over stored credentials):
export HTML2DECK_API_KEY=your-api-keyPersistent settings:
| Command | Description | Default |
| --- | --- | --- |
| html2deck config set api-key <key> | API key for cloud requests | — |
| html2deck config set size <size> | PPTX dimensions | 1920x1080 |
| html2deck config set webhook <url> | Default callback URL | — |
| html2deck config set retention-hours <n> | Cloud file retention (hours) | 3 |
Credentials are stored locally at ~/.deckflow/credentials.
CLI Reference
Conversion Flags
| Flag | Description | Default |
| --- | --- | --- |
| -h, --help | Show help | — |
| --version | Show version | — |
| -o, --output <path> | Output path | Same base name as input |
| -v, --verbose | Detailed logs to stderr | false |
| --quiet | Only errors and final result | false |
| --json | Machine-readable JSON on stdout | false |
| --report | Generate a conversion report | Off |
| --mode <mode> | auto, free, license, or cloud | auto |
| --width <pixels> | Playwright viewport width (height scales at 16:9) | 1920 |
| --platform <platform> | win, mac, ios, android, or linux | Detected |
| --embed-fonts | Embed fonts (cloud opt-in; license local defaults on) | cloud: false; license: true |
| --executable-path <path> | Chromium binary for local conversion (else HTML2DECK_CHROMIUM_EXECUTABLE_PATH env, then Playwright's bundle) | — |
| --exclude <selector> | CSS selector matching runtime/navigation elements to exclude | — |
| --identity-attribute <name> | Attribute carrying a stable element identity (default: data-element-id) | data-element-id |
| --force | Overwrite an existing output file (default: refuse) | false |
--quiet and --verbose cannot be used together. Output format is inferred from the -o extension (pptx or png).
JSON Output
html2deck index.html -o deck.pptx --json{
"ok": true,
"input": ["index.html"],
"output": "deck.pptx",
"format": "pptx",
"mode": "free"
}Programmatic API
Use the package as a library in Node.js. The library returns a Buffer (or PNG image buffers) — it never writes to disk on its own. Write the output yourself, or use the CLI for file output.
import { convertHtmlToPptx } from '@deckflow/html2deck';
const result = await convertHtmlToPptx({
input: 'index.html',
});
// result.data: Buffer containing the PPTX file
// result.slideCount: number of slides
// result.usedFonts: resolved font names
// result.stats: element/font/simplified statistics
import { writeFileSync } from 'node:fs';
writeFileSync('deck.pptx', result.data);Documentation
Start with the quick start, then learn the core concepts. Detailed CLI documentation is available in the docs/cli/ directory.
Agent Skill (Cursor / coding agents)
Install skill/html2deck/ so agents can convert HTML → PPTX without rediscovering CLI flags and slide conventions. See skill/README.md.
License
Proprietary. See LICENSE for details.
