Markdown to PDF (Fast & Standalone)
Instant, high-fidelity Markdown to PDF exporter for Visual Studio Code.
Zero server required. Zero headless browsers (no Puppeteer or Chrome). 100% offline & client-side.
⚡ Highlights
- Blazing Fast: Exports documents to PDF in milliseconds directly inside VS Code.
- 100% Private & Client-Side: No cloud APIs, no telemetry, and no heavy external dependencies like Puppeteer or Chromium.
- Instant 1-Touch Export: Skip save dialogs (
promptForSavePath: false) and auto-open PDFs immediately in your default viewer (autoOpen: true).
- Multi-File Batch Export: Select multiple Markdown files in File Explorer and export them all in a single batch with a live progress bar.
- Automatic Table of Contents: Generates an interactive TOC after the cover page with click navigation, or use
[TOC] / [toc] anywhere (supported in both PDF export and VS Code Markdown Preview).
- Responsive & Protected Tables: Table columns wrap long URLs and maintain clean proportions so tables never overflow the page.
- Dedicated Activity Bar Panel: Interactive control panel on your left sidebar to customize theme, page size, margins, and headers on the fly.
- Embedded Vector Icons: Native rendering for task list checkboxes (
- [x]), status badges, and 50+ vector icons.
- Universal Image & SVG Scaling: Full support for percentage widths (
width="20%") and fixed sizes (width="200px") for both raster images and SVGs.
⌨️ How to Use
Open any Markdown (.md) file, then export using any of these methods:
- Keyboard Shortcut:
- Mac:
Cmd + Alt + P
- Windows / Linux:
Ctrl + Alt + P
- Activity Bar Panel:
- Click the PDF icon on the left Activity Bar.
- Customize your theme, margins, and page settings, then click "Export to PDF" (you can also click "Save Current as Defaults").
- Editor Title Bar:
- Click the PDF icon in the top right corner of the editor title bar.
- Context Menus:
- Right-click anywhere in your Markdown editor and select "Export Markdown to PDF".
- In the left File Explorer, hover over any
.md file and click the inline PDF icon.
- Multi-File Batch Export:
- In the left File Explorer, hold
Cmd (Mac) or Ctrl / Shift (Windows/Linux) and select multiple .md files.
- Right-click and choose "Export Markdown to PDF" to convert all selected files at once without multiple save dialogs.
💡 Markdown Power Features
1. Custom Page Breaks
Force page breaks at specific sections using standard HTML syntax:
<div style="page-break-before: always;"></div>
2. Proportional Image & SVG Scaling
Scale your images and SVGs easily using HTML attributes or Markdown titles:
- HTML syntax:
<img src="image.svg" width="30%"> or <img src="photo.png" width="250px">
- Markdown syntax:
 or 
3. Automatic Table of Contents
By default, an interactive Table of Contents is generated automatically after your cover section. You can also place it explicitly anywhere in your markdown using [TOC], [toc], [[toc]], or <!-- toc -->. It renders seamlessly in both VS Code's built-in Markdown Preview and the exported PDF:
# My Document
[TOC]
## Section 1
Content here...
4. Interactive Task Checkboxes & Icons
- [x] Completed task with vector checkmark
- [ ] In-progress item
⚙️ Configuration Settings
Customize your default export preferences in VS Code Settings (Cmd+, or Ctrl+, ➔ search md2pdf):
| Setting |
Type |
Default |
Description |
md2pdf.theme |
string |
"modern" |
Preset theme (modern, github, academic, minimal, default) |
md2pdf.pageSize |
string |
"A4" |
Document paper size (A4, LETTER, LEGAL) |
md2pdf.pageOrientation |
string |
"portrait" |
Page orientation (portrait, landscape) |
md2pdf.pageMargins |
string |
"standard" |
Margin spacing (standard: 40pt, compact: 20pt, spacious: 60pt) |
md2pdf.tableOfContents |
boolean |
true |
Automatically insert a Table of Contents after initial page |
md2pdf.tableWidth |
string |
"75%" |
Maximum table width percentage for large tables |
md2pdf.header |
string |
"" |
Running header text (supports {page} and {pages}) |
md2pdf.footer |
string |
"Page {page} of {pages}" |
Running footer text (supports {page} and {pages}) |
md2pdf.watermark |
string |
"" |
Optional background watermark (e.g. DRAFT, CONFIDENTIAL) |
md2pdf.autoOpen |
boolean |
false |
Automatically open exported PDF in default viewer immediately |
md2pdf.promptForSavePath |
boolean |
true |
Show save dialog (set to false for instant export next to source file) |
💬 Support & Inquiries