Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Markdown to PDF & DOCXNew to Visual Studio Code? Get it now.
Markdown to PDF & DOCX

Markdown to PDF & DOCX

Zarul Izham

|
20 installs
| (0) | Free
Export Markdown to PDF and editable Word documents with responsive tables.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Markdown to PDF & DOCX

Export Markdown from VS Code to PDF or editable Word documents with readable code, local images, and responsive tables.

Use

Run Markdown: Export to PDF or Markdown: Export to DOCX from the Command Palette or right-click a .md file. Choose a destination. Current editor contents, including unsaved changes, are exported. The first PDF export offers a managed Chrome download; alternatively set mdToPdf.browserPath to a Chrome/Chromium executable. Later exports work offline with local assets.

Tables fit the printable width, wrap long values, allocate column widths according to content, and repeat headers across pages. Rows stay together when they fit; oversized rows may split. Use landscape for very wide tables. Extremely large column counts can still become difficult to read.

DOCX export works offline without Chrome. It creates native, editable Word tables with content-based column widths, wrapped text, repeating headers, and the configured table font size. Page size, orientation, margins and body font size apply to both formats. DOCX rows may split across pages to accommodate large cells. Word and LibreOffice may paginate differently. Code blocks use a monospace font; syntax colours are currently PDF-only. External HTTP(S) and email links remain clickable; relative links and anchors export as text.

Settings

Setting Default Purpose
mdToPdf.paperSize A4 A4 or Letter
mdToPdf.landscape false Wider pages
mdToPdf.marginMm 15 Page margins, 0–50 mm
mdToPdf.fontSize 12 Body font size, 8–24 px
mdToPdf.tableFontSize 11 Table font size, 6–24 px, independent of body size
mdToPdf.browserPath empty Existing browser executable

Scope

Desktop VS Code in trusted workspaces. With remote development, the browser runs on the extension host and must be supported there. PNG, JPEG and GIF images (plus WebP for PDF only) must be inside the Markdown file's folder or its subfolders. For untitled documents, image paths resolve against the output folder. Remote images, SVG, raw HTML, document scripts, Mermaid and math are not supported in this release. Missing or unsupported images stop export with an error.

Development

Run npm install, npm test, then press F5 to launch an Extension Development Host. Run npm run package to create a VSIX, then use Extensions: Install from VSIX. The publisher is a local development placeholder; set your Marketplace publisher before publishing.

For browser integration tests, set PDF_TEST_BROWSER to a Chrome executable before running npm test. Manually verify Command Palette/context menu export, Save dialog overwrite confirmation, cancellation, unsaved edits, and Open PDF on each target OS before publication.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft