Skip to main content

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​

FormatHow it is producedUse when
HTMLSelf-contained file with inlined CSS/assetsHost anywhere, embed in an iframe
PDFpdf-export skill → one SVG per page → svg_to_pdf.pyPrint, share, archive
PPTXpptx-svg-export skill → one SVG per slide → svg_to_pptx → DrawingMLEdit in PowerPoint or Keynote
ZIPProject archive (or selected files only)Backup, transfer, hand off source
DOCXDocument-surface exportWord round-trip for paged documents
MarkdownArtifact-to-markdown conversionDocs, wikis, README
PNG / JPEGPreview capture at a chosen scaleSlide 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
  1. The agent reads the HTML and identifies each <section class="slide">.
  2. It writes one SVG per slide at the deck's viewBox, reproducing layout, typography, drop caps, columns, and images with standard SVG elements.
  3. finalize_svg.py cleans up — embeds icons and images, flattens nested tspans, fixes image aspect ratios, converts rounded rects to paths.
  4. The svg_to_pptx package converts SVG → DrawingML. Text becomes real editable text frames, not flattened images.
  5. svg_quality_checker.py validates 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:

IdFamily
office-systemCalibri / Segoe UI — zero substitution risk on Windows
classic-printTimes New Roman / Garamond
modern-uiInter / Helvetica Neue
designer-classicHelvetica / Arial
humanist-serifPalatino / Georgia — warm long-form serif
friendly-sansTrebuchet MS / Verdana — high x-height, low-res friendly
tech-monoCourier 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]
FlagPurpose
--projectRequired — 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 jsonNDJSON 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​

SymptomCauseFix
PPTX fails immediately at the CLIpython-pptx/Pillow missingpython3 -m pip install python-pptx Pillow
PDF fails immediatelyNo python3 on PATHInstall Python 3
PPTX text is an imageThe converter fell back to a raster pathCheck the SVG for embedded raster text; text must be real <text> elements
Fonts substituted in PowerPointChosen family not installed on the viewer's machinePick office-system or designer-classic
PDF has blank pagesSVG used CSS styling that did not inlineInline every attribute; the brief already forbids rgba() and <style>