@presentation-md/export
v1.24.7
Published
Round-trip PowerPoint for presentation-md decks — export Deck JSON to editable .pptx, and import .pptx back into Deck JSON.
Downloads
14,243
Readme
@presentation-md/export
PPTX round-trip for presentation-md decks — export Deck JSON to native, editable PowerPoint (.pptx), and import .pptx back into Deck JSON.
Install
npm install @presentation-md/exportExport (Deck JSON → .pptx)
import { deckToPptxBuffer } from "@presentation-md/export";
import { loadTheme } from "@presentation-md/core";
import { writeFile } from "node:fs/promises";
const theme = await loadTheme("corporate");
const buf = await deckToPptxBuffer(deckJson, theme);
await writeFile("deck.pptx", buf);The resulting file opens in PowerPoint, Keynote (File → Open), and imports into Google Slides.
Browser-safe variants: deckToPptxBlob, deckToPptxArrayBuffer.
Remote http(s) and local file: / filesystem slide images are embedded when you
pass prefetchImages: true (or use CLI / MCP / Studio, which enable it). Local
reads stay inside allowedRoots (default: process.cwd()). Shared helper:
prefetchDeckImages.
const buf = await deckToPptxBuffer(deck, theme, { prefetchImages: true });Import (.pptx → Deck JSON)
import { pptxToDeck } from "@presentation-md/export/import";
import { readFile } from "node:fs/promises";
const buf = await readFile("board-deck.pptx");
const deck = await pptxToDeck(buf, { theme: "corporate" });Lower-level API: extractPptx (parse OOXML) + mapExtractedToDeck (layout inference).
CLI & MCP
Most users reach export/import through:
- CLI:
presentation-md-render deck.json --format pptxand--from-pptx deck.pptx - MCP:
export_deck,import_pptx
Fidelity
See references/pptx-fidelity.md for fonts, colors, images, and layout caveats.
