Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Markdown to PDF ProNew to Visual Studio Code? Get it now.
Markdown to PDF Pro

Markdown to PDF Pro

Ehtesham Nasim

|
1 install
| (0) | Free
Convert Markdown to beautiful PDFs with Mermaid diagram support, cover pages, TOC, and more
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

md2pdf — Markdown to PDF Converter

Version Downloads License

Convert Markdown to beautiful, professional PDFs with full Mermaid diagram support.


✨ Features

Feature Description
📊 Mermaid Diagrams Flowcharts, sequence diagrams, Gantt charts, ER diagrams, and more
📄 Cover Pages Professional title pages with logo, author, version, and confidential badge
📑 Table of Contents Auto-generated, numbered, with clickable links
🎨 4 Themes GitHub, Professional, Minimal, Academic
💻 5 Code Themes GitHub, Monokai, Dracula, One Dark, GitHub Dark
🔢 Line Numbers Optional line numbers for code blocks
💧 Watermarks Configurable text watermarks (DRAFT, CONFIDENTIAL, etc.)
📐 Math Support KaTeX equations (inline and block)
📖 Page Numbers Multiple formats (numeric, Page X of Y)

🚀 Quick Start

  1. Install from VS Code Marketplace
  2. Open any .md file
  3. Press Cmd+Shift+E (Mac) or Ctrl+Shift+E (Windows)
  4. PDF is created in the same folder!

Other Ways to Export

  • Status Bar: Click the PDF button when editing Markdown
  • Context Menu: Right-click → "Export to PDF"
  • Command Palette: Cmd+Shift+P → "md2pdf: Export to PDF"

⚙️ Configuration

Option 1: VS Code Settings

Open Settings (Cmd+,) and search for "md2pdf":

Setting Default Description
md2pdf.theme github Document theme
md2pdf.codeTheme github Syntax highlighting theme
md2pdf.coverPage false Enable cover page
md2pdf.coverTitle "" Cover page title
md2pdf.coverSubtitle "" Cover page subtitle
md2pdf.coverAuthor "" Cover page author
md2pdf.coverOrganization "" Organization name
md2pdf.coverLogo "" Logo path or URL
md2pdf.coverVersion "" Version number
md2pdf.coverConfidential false Show CONFIDENTIAL badge
md2pdf.toc false Generate table of contents
md2pdf.tocTitle "Table of Contents" TOC heading
md2pdf.tocMaxLevel 3 TOC depth (1-6)
md2pdf.watermark "" Watermark text
md2pdf.watermarkOpacity 0.08 Watermark opacity
md2pdf.showPageNumbers true Show page numbers
md2pdf.showLineNumbers false Line numbers in code
md2pdf.pageSize A4 Page size

Option 2: YAML Frontmatter

Add configuration directly in your Markdown file:

---
title: My Document
theme: professional
coverPage: true
coverTitle: Project Documentation
coverSubtitle: Technical Guide v2.0
coverAuthor: Your Name
coverOrganization: Your Company
coverLogo: ./images/logo.png
toc: true
tocTitle: Contents
watermark: DRAFT
codeTheme: monokai
showLineNumbers: true
---

Option 3: Config Files

  1. Create: Cmd+Shift+P → "md2pdf: Create Config File"
  2. Export: Cmd+Shift+P → "md2pdf: Export with Config"

📊 Mermaid Diagram Support

All Mermaid diagram types are fully supported:

  • Flowcharts — Process flows, decision trees
  • Sequence Diagrams — API calls, interactions
  • Gantt Charts — Project timelines
  • Class Diagrams — UML structures
  • State Diagrams — State machines
  • ER Diagrams — Database schemas
  • Pie Charts — Data visualization
  • Git Graphs — Branch visualization

🎨 Themes

Theme Best For
GitHub General documentation
Professional Corporate documents
Minimal Clean, simple reports
Academic Papers, formal reports

💻 Code Themes

Theme Style
GitHub Light, clean
Monokai Dark, classic
Dracula Dark, purple
One Dark Atom-style
GitHub Dark Dark GitHub

📁 Output Options

PDFs are saved in the same directory by default.

Change output location in settings:

{
  "md2pdf.outputDirectory": "./pdf"
}

🔧 Requirements

  • VS Code 1.74.0+
  • Puppeteer (auto-installed on first use)

📝 Changelog

1.0.0

  • Initial release
  • Full Mermaid diagram support
  • Cover pages with logo
  • Table of contents generation
  • 4 document themes
  • 5 code syntax themes
  • Watermark support
  • Math equations (KaTeX)
  • Line numbers for code
  • Page numbering options

📄 License

MIT © Ehtesham Nasim


Made with ❤️ for developers who love Markdown

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft