Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>MD & PDF ToolkitNew to Visual Studio Code? Get it now.
MD & PDF Toolkit

MD & PDF Toolkit

Bach TV

|
4,012 installs
| (2) | Free
Preview Markdown, export to PDF/DOCX, and view PDF files - all in one toolkit
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

📄 MD & PDF Toolkit

Your All-in-One Markdown Powerhouse for VS Code

A lightweight VS Code extension for previewing, exporting, and converting Markdown files — no external dependencies needed.

VS Code License Version

Export to PDF · Export to DOCX · Export to PNG/JPEG · Built-in PDF Viewer · Live Preview


✨ Highlights

Feature Description
⚡ Zero Setup No Pandoc, no wkhtmltopdf — works right out of the box
📊 Mermaid & PlantUML Render flowcharts, sequence diagrams, and UML natively
➗ LaTeX / KaTeX Beautiful math equations with $...$ and $$...$$
🔍 Built-in PDF Viewer Search, copy, and navigate PDFs without leaving VS Code
🎨 Custom CSS Style your exports exactly the way you want
🔒 Privacy First Zero telemetry, zero data collection

🚀 Quick Start

1. Install the extension from VS Code Marketplace
2. Open any .md file
3. Use `Ctrl+K V` / `Cmd+K V` for preview, or `Ctrl+Shift+P` → type "MDX"
4. Done! 🎉

📦 Export Formats

📕 PDF Export

  • Full Markdown rendering
  • Syntax-highlighted code blocks
  • Mermaid & PlantUML diagrams
  • Math equations (KaTeX)
  • Emoji support
  • Custom headers & footers
  • Auto wide-page for long code lines
  • Page formats: A3, A4, A5, Letter, Legal

📘 DOCX Export

  • Proper Word heading styles
  • Bold, italic, inline code
  • Formatted tables
  • Blockquotes with indentation
  • Ordered & unordered lists
  • Embedded images
  • No Chrome needed!

🖼️ Image Export (PNG / JPEG)

  • Full-page screenshot of rendered Markdown
  • Configurable JPEG quality (0–100)
  • Same rendering engine as PDF
  • Perfect for sharing on social media

🔄 DOCX Conversion

  • DOCX → PDF — convert Word docs to PDF
  • DOCX → Markdown — extract content as .md
  • Right-click any .docx in Explorer

🎯 Commands

Command Description Shortcut
MDX: Open Preview to Side Live Markdown preview panel Ctrl+K V / Cmd+K V
MDX: Export to PDF Export with save dialog —
MDX: Quick Export to PDF Export to default path instantly Ctrl+Alt+P / Cmd+Alt+P
MDX: Export to DOCX Export as Word document —
MDX: Quick Export to DOCX Quick export Word doc Ctrl+Alt+D / Cmd+Alt+D
MDX: Export to PNG Export as PNG image —
MDX: Export to JPEG Export as JPEG image —
MDX: Convert DOCX to PDF Convert .docx → .pdf —
MDX: Convert DOCX to Markdown Convert .docx → .md —

💡 Tip: The preview shortcut follows the familiar VS Code Markdown convention. The two quick-export shortcuts are bound by default; the rest stay unbound to keep conflicts low and can be customized in Keyboard Shortcuts.


⚙️ Configuration

Configure in VS Code Settings (Ctrl+, / Cmd+,) under MDX Exporter Lite.

🗂️ General Settings
Setting Type Default Description
outputDirectory string "" Default output directory (empty = same as source)
openAfterExport boolean true Auto-open file after export
saveBeforeExport boolean true Auto-save before export
formatBeforeExport boolean true Auto-format before export
quickExportOverwrite boolean false Overwrite without prompting on quick export
📄 PDF Settings
Setting Type Default Description
pdfPageFormat string A4 Page format (A4, Letter, Legal, A3, A5)
pdfMargin string 20mm Page margin (e.g. 20mm, 1in)
displayHeaderFooter boolean false Show header/footer in PDF
headerTemplate string "" HTML template for PDF header
footerTemplate string page/total HTML template for PDF footer
autoWidePageForCodeBlocks boolean true Auto switch to wide page for long code lines
wideLineThreshold number 140 Character threshold for wide-page trigger
widePageFormat string A3 Page format in wide mode
widePageMargin string 10mm Page margin in wide mode
🎨 Styling & Preview
Setting Type Default Description
styles array [] Custom CSS file paths for exports
allowRawHtmlInPreview boolean false Allow raw HTML in preview
allowUnsafeEvalInPreview boolean false Enable unsafe-eval in preview CSP
jpegQuality number 90 JPEG export quality (0–100)

📝 Supported Markdown Features

Standard Markdown

  • Headings (h1–h6)
  • Bold, italic, inline code
  • Code blocks with syntax highlighting
  • Tables, blockquotes, lists
  • Links, images, horizontal rules

Extended Features

  • 📊 Mermaid diagrams (flowchart, sequence, etc.)
  • 🔬 PlantUML diagrams (@startuml...@enduml)
  • ➗ Math equations ($x^2$, $$\int f(x)dx$$)
  • 😄 Emoji shortcodes (:smile: → 😄)

📋 Requirements

Export Type Requires
PDF / PNG / JPEG Google Chrome, Chromium, or Microsoft Edge
DOCX ✅ Nothing — works immediately!

📌 Most systems already have Chrome or Edge installed. The extension auto-detects installed browsers.


🔧 Troubleshooting

❌ PDF export fails — "Chrome not found"

The extension uses Chrome/Chromium/Edge for PDF generation. Install one of:

  • Google Chrome
  • Chromium
  • Microsoft Edge (pre-installed on Windows 10/11)
❌ Images not appearing in export
  • Use relative paths for images in your Markdown
  • Ensure image files exist at the specified location
  • Check that image file extensions match (case-sensitive on Linux)
❌ Export takes too long
  • Large documents with many images may take extra time
  • Complex tables or diagrams increase processing time
  • Try breaking very large documents into smaller files
❌ Mermaid diagrams show as raw code
  • Make sure you're using fenced code blocks with the mermaid language tag
  • If using the preview, you may need to enable allowUnsafeEvalInPreview
  • In exports, Mermaid rendering is automatic

🏗️ Architecture

src/
├── extension.ts          # Extension entry point & command registration
├── logging.ts            # Logging utilities
├── commands/             # Command handlers (export, preview, convert)
├── converters/           # Core conversion engines (MD→PDF, MD→DOCX, etc.)
├── preview/              # Custom WebView preview panel
├── pdf-viewer/           # Built-in PDF viewer implementation
└── types/                # TypeScript type definitions

🔐 Privacy

This extension does not collect any telemetry or user data. All processing happens locally on your machine.


🤝 Contributing

Contributions are welcome! Feel free to:

  1. 🐛 Report bugs
  2. 💡 Request features
  3. 🔀 Submit pull requests

📜 License

This project is licensed under the MIT License — see the LICENSE file for details.


📌 Changelog

See CHANGELOG.md for the full version history.


Made with ❤️ by bachtv

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