Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Markdown to PDF (Shiki)New to Visual Studio Code? Get it now.
Markdown to PDF (Shiki)

Markdown to PDF (Shiki)

rypka-hauer

| (0) | Free
Export Markdown to PDF with editor-accurate, Shiki-highlighted code blocks (VS Code themes & grammars), GitHub-flavored Markdown, YAML front matter, and configurable page & output options.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Markdown to PDF

A VS Code extension that exports Markdown files to PDF with GitHub-flavored Markdown rendering, editor-accurate syntax-highlighted code blocks, YAML front matter support, and configurable output.

Code blocks are highlighted with Shiki, which uses the same TextMate grammars and VS Code themes the editor itself ships — so your exported code looks like it does in VS Code, across hundreds of languages and popular themes (including the built-in Light+ / Dark+).

Usage

From the Explorer: Right-click any .md file → Export to PDF or Export to PDF As…

From the editor: Open a .md file and click the export icons in the editor title bar.

  • Export to PDF — saves alongside the source file with the same name
  • Export to PDF As… — opens a Save dialog to choose the output path

Settings

Setting Default Description
codeBlocks.enabled true Syntax-highlight fenced code blocks
codeBlocks.theme github-light Shiki/VS Code theme: github-light, github-dark, light-plus, dark-plus, one-light, one-dark-pro, dracula, nord, monokai, solarized-light, solarized-dark, catppuccin-latte, catppuccin-mocha, vitesse-light, vitesse-dark, min-light, min-dark
frontMatter.render false Include YAML front matter in the PDF
frontMatter.style metadata-box Front matter style: metadata-box, table, or code-block
page.size Letter Paper size: Letter, A4, or Legal
page.margins normal Margins: normal, narrow, wide, or none
stylesheet github Base stylesheet: github, none, or an absolute path to a custom .css file
output.overwrite overwrite When the output file exists: overwrite, prompt, or increment
output.openAfterExport true Open the exported PDF in the system viewer
images.resolveRelativePaths true Rewrite relative image paths to absolute file:// URIs

All settings are under the rypka-hauer.markdownToPdf namespace.

Stack

  • Puppeteer (bundled Chromium) — PDF rendering
  • marked v12 — Markdown parsing (GFM)
  • Shiki — Code block syntax highlighting with VS Code grammars & themes
  • gray-matter — YAML front matter parsing
  • github-markdown-css — Default stylesheet

Requirements

VS Code 1.90 or later. No other dependencies — Chromium is bundled with Puppeteer.

License

MIT

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