A Visual Studio Code extension that exports Markdown files to PDF, HTML, PNG, or JPEG with diagrams, math, and GitHub-style extras.
Overview
Markdown PDF is a Visual Studio Code extension that converts Markdown documents into PDF, HTML, PNG, or JPEG files without leaving the editor. It extends the default Markdown rendering with features aimed at richer exports, such as task lists, heading anchors, include files, admonition-style containers, syntax highlighting, emoji, PlantUML, Mermaid, and KaTeX math.
Exports rely on a Chromium-based browser. The extension tries a configured executable path first, then installed Google Chrome, Microsoft Edge, or Chromium on the system, and can download a managed Chromium on first use unless auto-download is turned off. PDF output supports headers, footers, margins, orientation, and related print options; image output supports quality and clipping settings.
You trigger conversion from the command palette, the editor context menu, or optional convert-on-save. Settings control output directory, stylesheets, sanitization of raw HTML, highlight.js themes, and paths for PlantUML and Mermaid servers. A diagnostics command helps collect environment details when exports fail.
Behavior changes in recent major versions include stricter front matter parsing, updated heading slug rules compatible with GitHub-style anchors, and default HTML sanitization modes that strip some raw HTML tags from exported content.
Key features
- Export to PDF, HTML, PNG, JPEG
- PlantUML and Mermaid diagrams
- KaTeX math rendering
- GitHub-style task lists and heading IDs
- Markdown include fragments
- Syntax highlighting via highlight.js
- Chromium-based rendering pipeline
- Convert on save option
Use cases
- Turn READMEs into PDF handouts
- Export docs with diagrams and math
- Batch-save Markdown as images
- Share styled HTML from notes