Export & Import
Export is skill-driven, not a library call. PPTX and PDF are produced by the agent following a bundled skill: it authors one SVG per slide that visually reproduces the HTML, then a deterministic Python script assembles the file. That is why text stays editable in PowerPoint and why the PDF matches the browser rendering.
Formats
| Format | How it is produced | Use when |
|---|---|---|
| HTML | Self-contained file with inlined CSS/assets | Host anywhere, embed in an iframe |
pdf-export skill → one SVG per page → svg_to_pdf.py | Print, share, archive | |
| PPTX | pptx-svg-export skill → one SVG per slide → svg_to_pptx → DrawingML | Edit in PowerPoint or Keynote |
| ZIP | Project archive (or selected files only) | Backup, transfer, hand off source |
| DOCX | Document-surface export | Word round-trip for paged documents |
| Markdown | Artifact-to-markdown conversion | Docs, wikis, README |
| PNG / JPEG | Preview capture at a chosen scale | Slide thumbnails, social crops |
PPTX
The old path used pptxgenjs and required a slides.json structure, falling back to screenshotting each slide. That is gone. PPTX now goes through an SVG intermediate:
HTML deck ──► one SVG per slide ──► finalize_svg.py ──► svg_to_pptx ──► DrawingML shapes
- The agent reads the HTML and identifies each
<section class="slide">. - It writes one SVG per slide at the deck's
viewBox, reproducing layout, typography, drop caps, columns, and images with standard SVG elements. finalize_svg.pycleans up — embeds icons and images, flattens nested tspans, fixes image aspect ratios, converts rounded rects to paths.- The
svg_to_pptxpackage converts SVG → DrawingML. Text becomes real editable text frames, not flattened images. svg_quality_checker.pyvalidates technical compliance (viewBox, banned elements) before the final write.
Why not python-pptx directly? Hand-translating CSS grids and multi-column text into PPTX coordinates silently drifts — overlapping text, lost typography, broken columns. SVG is a format a model can author accurately, and the converter is deterministic.
Font choice
PPTX export asks which font family to apply across the deck. Six families ship:
| Id | Family |
|---|---|
office-system | Calibri / Segoe UI — zero substitution risk on Windows |
classic-print | Times New Roman / Garamond |
modern-ui | Inter / Helvetica Neue |
designer-classic | Helvetica / Arial |
humanist-serif | Palatino / Georgia — warm long-form serif |
friendly-sans | Trebuchet MS / Verdana — high x-height, low-res friendly |
tech-mono | Courier New / JetBrains Mono — data-dense technical decks |
Pre-answer the question to skip the round trip:
tfdesign export pptx --project q3-deck --font modern-ui
--font-override "<text>" adds an extra instruction applied after the family defaults.
Dependencies
python-pptx and Pillow. The CLI runs a preflight before the first round, so a missing dependency is one clear message with the exact install command instead of a failure twelve rounds in, after every SVG has already been generated:
python3 -m pip install python-pptx Pillow
PDF
HTML ──► one SVG per page ──► svg_to_pdf.py ──► multi-page PDF
Page-sized views packaged by a stdlib-only script — no pip install needed. For decks, each slide is one page; for documents, each page block is one page. The deck viewer's Export as PDF (all slides) uses the same pipeline for every slide rather than only the visible one.
A browser-print path still exists as a fallback when the native PDF bridge is unavailable, but the skill pipeline is the fidelity path.
tfdesign export pdf --project q3-deck
HTML
A single file with CSS and assets inlined — no external requests. Use Export as standalone HTML.
ZIP
Two variants:
- Download as .zip — the current artifact as a single-file archive.
- Export selected files — a batch archive of chosen files.
The CLI can mirror the whole project to a folder instead, which is more useful for code handoff:
tfdesign run --project q3-deck --mirror-root ./design
That performs an exact create/update/delete sync of non-hidden files into ./design/<project-slug>/, so the mirror always matches the project rather than accumulating stale files.
Markdown and DOCX
- Markdown — plain-text rendering of the artifact, or a skill-defined renderer when the artifact declares one.
- DOCX — document-surface only, producing a Word file from the paged canvas.
Export from the CLI
tfdesign export <pptx|pdf> --project <id|name> [options]
| Flag | Purpose |
|---|---|
--project | Required — an export never creates a project |
--file <name> | Source HTML (defaults to the project's entry file) |
--font <id> | Pre-answer the PPTX font question |
--font-override <text> | Extra font instruction |
--format json | NDJSON events, same contract as run |
--mirror-root <dir> | Mirror project files afterwards |
Exit codes match run: 0 ok · 2 usage · 3 daemon unreachable · 4 run failed · 5 form unanswered · 130 canceled.
The brief the CLI sends is generated from @open-design/contracts, and the app's Export menu imports the same module. The CLI, the MCP surface, and the web menu therefore send byte-identical instructions — an export from any entry point produces the same artifact from the same source.
Export over MCP
There is no dedicated export tool. An agent that already has MCP access picks up the project with get_artifact and then either drives a run or asks to convert. The conversion skills' scripts are reachable through skill_files / skill_file_read / skill_script_run.
Import
Claude Design ZIP
Drop a Claude Design export ZIP onto the welcome screen. TF Design imports the project, opens the entry file as a tab, and seeds a continue prompt. The imported project is fully editable.
Folder import
Point at an existing folder and the daemon scans it into a project (POST /api/import/folder). Useful for adopting a prototype that was authored elsewhere.
File uploads
Up to 8 images per upload, on the splash screen or mid-conversation. Supported: PNG, JPG, GIF, WEBP, SVG.
Brand material
Screenshots, brand-guide PDFs, and URLs are all valid design-system source material. See Creating Custom Design Systems.
Troubleshooting export
| Symptom | Cause | Fix |
|---|---|---|
| PPTX fails immediately at the CLI | python-pptx/Pillow missing | python3 -m pip install python-pptx Pillow |
| PDF fails immediately | No python3 on PATH | Install Python 3 |
| PPTX text is an image | The converter fell back to a raster path | Check the SVG for embedded raster text; text must be real <text> elements |
| Fonts substituted in PowerPoint | Chosen family not installed on the viewer's machine | Pick office-system or designer-classic |
| PDF has blank pages | SVG used CSS styling that did not inline | Inline every attribute; the brief already forbids rgba() and <style> |