Skip to content

PowerPoint export

astro-slides export --format pptx produces a real, editable PowerPoint file — not a deck of slide screenshots. Text is real text frames, lists are real bullets, tables are native tables, and speaker notes carry over. Your colleague can open the .pptx in PowerPoint, Keynote, LibreOffice, or Google Slides and edit it directly.

Terminal window
astro-slides export --format pptx

The default output file is <deck>.pptx in the project directory. Use --output to choose a path:

Terminal window
astro-slides export --format pptx --output quarterly-review.pptx

The exporter is built on PptxGenJS, which writes genuine OOXML. See ADR-0007 for the rationale behind choosing editable OOXML over rasterized slides.

The exporter reads each rendered slide and maps its content to native OOXML shapes:

Slide contentBecomes
Headings and paragraphsEditable text frames
ul / ol listsNative bulleted lists (with indent levels)
TablesNative, editable tables
ImagesInlined images (embedded as data URLs)
Inline linksText-run hyperlinks
Speaker notesThe slide’s Notes pane

Positions and font sizes are derived from each element’s on-screen rectangle, so the layout of the exported slide follows what the deck actually renders.

Some content can’t be expressed as editable OOXML. Those pieces are rasterized — captured as an image and placed on the slide:

  • Code blocks — syntax highlighting doesn’t round-trip to OOXML text runs, so each code block is screenshotted and placed as an image.
  • Slides marked exportAs: image — the whole slide is rasterized (see below).
  • Slides with no mappable content — a slide built purely from visual composition (absolutely-positioned elements, SVG art) that yields no editable block is automatically rasterized instead of exporting blank.
  • Every slide, when --rasterize is passed — see below.

Rasterize every slide to a full-slide image. Use this when editability doesn’t matter and you want pixel-faithful reproduction of custom CSS, web components, or effects that OOXML can’t represent:

Terminal window
astro-slides export --format pptx --rasterize

To rasterize a single slide while keeping the rest editable, set exportAs: image in that slide’s frontmatter:

---
exportAs: image
---
# This slide is rendered as a picture
Because it uses a custom animation OOXML can't represent.

PPTX honors the shared export flags:

  • --range "1,3-5,8" — export a subset of slides (Slidev-style spec, 1-indexed).
  • --output <path> — output .pptx path (default <deck>.pptx).
  • --dark — force the dark color scheme.
  • --executable-path <path> — bring your own Chromium binary.
Terminal window
astro-slides export --format pptx --range 1-10 --output deck.pptx

Out of scope for the current exporter:

  • Charts — no embedded-Excel chart mapping (there’s no chart primitive in the deck format yet).
  • Theme palette — colors are applied per-shape; there’s no full design-token → OOXML document-theme palette mapping.
  • Animations and slide transitions — these do not survive the OOXML round trip.
  • packages/cli/src/main.ts (PPTX section) — pxToIn / inToEmu / parseCssColor, the PptxRun / PptxElement / SlideModel types, buildPptxSlide / buildDeckPptx mapper, the in-browser DOM_WALKER, and exportDeckPptx.
  • packages/core/src/routes/slide.astro — the as-notes-data speaker-notes payload and per-slide data-export-as="image" attribute the exporter reads.
  • packages/cli/package.json@playwright/test declared as an optional peer.
  • docs/decisions/0007-pptxgenjs-for-editable-pptx.md — the editable-OOXML decision.
  • docs/built/13-export-pptx.md — phase notes.
  • docs/architecture/cli.md — full CLI flag surface.