Guide
How to Convert Markdown Slides to PDF (Marp, reveal.js, Slidev)
Writing slides in Markdown is a quiet superpower: you get a version-controllable deck in plain text, no dragging boxes around, and a clean separation between content and design. When you need to share that deck — as a handout, an email attachment, or a backup — PDF is the universal format. This guide covers exporting to PDF from the three main Markdown slide tools, plus how to turn your notes into a companion document.
How Markdown slides work
Most Markdown slide tools use a separator to split content into slides — typically --- (a horizontal rule) between them:
# Title Slide
Presenter name · 2026
---
## Agenda
- Problem
- Approach
- Results
---
## Thank You
Each block between separators becomes one slide. The tool you choose then renders and exports the deck.
Marp — the simplest exporter
Marp is the most direct Markdown-to-slides tool. With the Marp CLI, one command gives you a PDF:
marp deck.md --pdf
Add a directive at the top of your file to pick a theme and page size:
---
marp: true
theme: default
paginate: true
---
paginate: true adds slide numbers. There's also a Marp for VS Code extension that previews the deck and exports PDF from the command palette — handy if you live in the editor.
reveal.js — export via the browser
reveal.js is the powerhouse for web-based decks. It exports to PDF through the browser's print engine using a special print stylesheet:
- Open your presentation URL and append
?print-pdfto it (e.g.index.html?print-pdf). - Open the browser print dialog (
Ctrl/Cmd + P). - Set destination to Save as PDF, Layout: Landscape, and margins to None.
- Enable Background graphics so slide backgrounds render.
- Save.
For automation, the decktape tool renders reveal.js (and other frameworks) to PDF headlessly: decktape reveal http://localhost:8000 deck.pdf.
Slidev — one command
Slidev (popular with developers) has a built-in export:
npm run build
# or, for a PDF specifically:
slidev export slides.md
It renders each slide to a page and bundles a clean PDF, including code highlighting and diagrams.
Tool comparison
| Tool | PDF export | Best for |
|---|---|---|
| Marp | marp --pdf or VS Code |
Fast, simple decks |
| reveal.js | ?print-pdf + browser print, or decktape |
Rich, web-based presentations |
| Slidev | slidev export |
Developer-focused, code-heavy decks |
Slides vs. a document
One thing worth being clear about: slide tools produce landscape, one-idea-per-page decks — great as a presentation, not always ideal as something to read. If what you actually want is a readable handout or report from the same content (paragraphs, not bullet fragments), that's a different job.
For the written companion — your speaker notes, a detailed write-up, or a leave-behind document — plain Markdown converted to a portrait PDF reads far better than exported slides. Paste that Markdown into a browser converter like ConvertMDapp, preview it, and export a clean, selectable-text document. It runs entirely in your browser, so nothing is uploaded — a nice pairing with a Marp or reveal.js deck for the same talk.
Quick guidance
- Presenting or handing out the deck itself? Export from your slide tool (Marp
--pdf, reveal.js?print-pdf, orslidev export). - Sharing the written version or notes? Convert the Markdown to a document PDF with a browser converter.
- Both? Ship the deck PDF for the visuals and a document PDF for the detail.
For the fundamentals of the document side, see the complete guide to converting Markdown to PDF.
FAQ
How do I export a Marp deck to PDF?
Run marp deck.md --pdf with the Marp CLI, or use the Marp for VS Code extension and export from the command palette. Add paginate: true to your front matter for slide numbers.
How do I save reveal.js slides as a PDF?
Append ?print-pdf to the presentation URL, open the print dialog, choose Save as PDF in Landscape with no margins, and enable background graphics. Or use decktape for a headless, scriptable export.
Can I turn my slide notes into a readable PDF? Yes — put the notes or write-up in plain Markdown and convert it to a portrait document PDF with a browser converter. It reads much better than exported landscape slides for anything meant to be read rather than presented.