| name | pdf-export |
| description | Produces a typeset PDF artifact from any source file — code, Markdown, HTML, chat JSON, or structured Dojo files (specs, ADRs, skills). Use when: "export this to PDF", "generate a PDF of this file", "make a PDF from this". |
| model | sonnet |
| category | publishing |
| triggers | ["export this to PDF","generate a PDF of this file","make a PDF from this"] |
| tier | 1 |
| agents | ["primary"] |
| tool_dependencies | ["file_system"] |
| inputs | [{"name":"source_path","type":"string","description":"Path or glob pattern to the source file(s) to export","required":true},{"name":"output_path","type":"string","description":"Output path for the generated PDF file","required":false},{"name":"theme","type":"string","description":"Typography theme — light or dark","required":false}] |
| outputs | [{"name":"pdf_artifact","type":"ref","format":"cas-ref","description":"Typeset PDF file written to the specified output path"}] |
PDF Export Skill
Version: 0.1.0
Created: 2026-04-08
Author: Dojo Genesis
Purpose: Convert any file into a beautifully typeset PDF using Pretext's Canvas-based typography engine for precise text measurement and layout.
I. The Philosophy: Typography as Respect
A PDF is a permanent artifact. Unlike a terminal dump or a browser render, a PDF says "this was worth preserving." Pretext-powered export treats every character with the same care a typesetter would — measuring widths on a real Canvas, computing line breaks honestly, and placing glyphs with sub-pixel precision. The result: PDFs that are not just functional, but beautiful.
II. When to Use This Skill
- Code review artifacts: Export source files with syntax highlighting for offline review or archival.
- Documentation publishing: Convert Markdown specs, ADRs, or READMEs into distributable PDFs.
- Chat preservation: Export DojoChat conversations with faithful typography and bubble layout.
- Structured file bundles: Batch-export SKILL.md files, handoff packages, or decision records.
- HTML snapshots: Render HTML pages to PDF preserving layout and styles.
III. Steps
Step 1: Identify Source Files
Determine the files to export and their types. Supported formats:
| Format | Renderer | Features |
|---|
.ts, .js, .go, .py, .rs, etc. | Code | Syntax highlighting via Shiki, line numbers, theme support |
.md | Markdown | Heading hierarchy, code blocks, tables, links as footnotes |
.html | HTML | DOM-faithful rendering, CSS preservation |
| Chat JSON | Chat | Bubble layout, Pretext shrink-wrap, disposition typography |
SKILL.md, ADR-*.md | Structured | Section-aware layout, metadata headers, cross-references |
Step 2: Configure Typography
Choose typography settings or accept defaults:
- Inter (body), Recursive (code), Fraunces (display)