VS Code Native Markdown to PDF
A blazing fast, highly accurate Markdown to PDF exporter for Visual Studio Code.
Unlike other extensions that bundle their own Markdown parsers, this extension hooks directly into the VS Code Native Markdown Engine. Whatever you see in your built-in VS Code Markdown Preview—including KaTeX math equations, syntax highlighting, and Mermaid diagrams—will be exactly what you get in your exported PDF.
🚀 Features
- Perfect Fidelity: Zero discrepancy between VS Code's preview and your PDF.
- Math & Highlights: Built-in support for KaTeX block/inline math and
highlight.js syntax highlighting.
- Lightweight: Uses
puppeteer-core to connect to your local Chrome/Edge browser. No bloated 150MB+ Chromium binaries bundled!
- Seamless UI: Export via the Editor Title button, Status Bar, or Right-Click Context Menu.
- Zero Config (mostly): Works out of the box for macOS and Windows.
📸 Usage
- Open any
.md file.
- Click the PDF icon
[ PDF ] in the top right corner of the editor.
- Alternatively: Right-click the editor/file and select "Markdown to PDF: Export".
- Alternatively: Click "Export PDF" in the bottom-right status bar.
- Find your highly formatted
xxx.pdf file right next to your Markdown file!
⚙️ Extension Settings
This extension is highly customizable to fit your personal printing needs. You can edit the following in your VS Code Settings (Cmd+, or Ctrl+,):
markdownToPdf.chromePath: (Important) If the extension fails to find your browser automatically, paste the absolute path to your Google Chrome or Microsoft Edge executable here.
markdownToPdf.format: Paper format. Default is A4. (Options: A4, Letter, Legal, Tabloid).
markdownToPdf.margin: Paper margin size. Default is 20mm.
markdownToPdf.customCss: Absolute path to a .css file on your machine if you want to override the default GitHub Markdown Theme.
🛠 Troubleshooting
Q: I get "Chrome not found at..." error.
A: The extension tries to guess where Chrome is installed. Check your settings and manually enter the path to your browser under markdownToPdf.chromePath.
Q: Is there any data sent to the cloud?
A: No. Everything is rendered 100% locally on your machine using your own browser engine.
🤝 Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
Enjoy exporting flawless PDFs! 🎉