Pro

Export markdown to PDF on Windows — with nested bookmarks

Convert markdown to PDF on Windows with real nested bookmarks built from your heading tree. The Pro export goes beyond the browser print dialog.

Last updated

MD View has two ways to produce a PDF from a .md file. One is the browser-style print dialog, free and good enough for a quick share. The other is the Pro export — it builds a real PDF document with nested bookmarks generated from your heading tree, sets typography for paged output, and writes a file that’s actually pleasant to read in a PDF viewer.

This page covers both, but the differentiator is the bookmarks. If you’ve tried “Save as PDF” from VS Code’s preview, Typora’s free tier, or your browser, you’ve probably noticed the bookmarks panel is empty or contains a flat list of every heading. MD View’s Pro export is the only Windows markdown viewer that produces nested bookmarks matching your heading hierarchy.

The two paths

Quick PDF — browser print (Free)

Ctrl+P opens WebView2’s native print dialog. Pick “Save as PDF” or any installed PDF printer, click Print. Output is a single-stream PDF with the rendered content — no bookmarks, no document outline.

Good for: a quick share, a paper printout, a one-shot archive.

Pro PDF export — File → Export as PDF…

Ctrl+Shift+E opens MD View’s own export dialog. Output is a PDF with:

  • Nested bookmarks built from H1 / H2 / H3 / H4 — the PDF reader’s outline panel mirrors your document structure.
  • Page-sized typography — wider margins, higher line-height, no truncated code blocks.
  • Working internal links — heading anchors resolve to PDF pages, not absolute URLs.
  • Configurable page size — A4, Letter, or custom.
  • Theme baked in — light theme by default; switch in Settings if you want dark output.

The export uses a hidden WebView2 instance + Chromium DevTools Protocol’s Page.printToPDF to render the content, then a post-processing pass injects the nested bookmarks. The whole thing runs in-process — no external Chrome install, no Pandoc dependency.

Nested bookmarks — the differentiator

If your doc looks like:

# Introduction

## Background
## Goals

# Design

## API
### Endpoints
### Auth
## Storage

# Open questions

The PDF outline looks like:

Introduction
├─ Background
└─ Goals
Design
├─ API
│  ├─ Endpoints
│  └─ Auth
└─ Storage
Open questions

That’s the navigation pane in Adobe Reader, Foxit, SumatraPDF, the native macOS Preview — anywhere you open the file. Click a bookmark and the reader jumps. Long technical documents become navigable without a separate TOC page.

Customizing output

In File → Export as PDF… you can set:

  • Page size: A4 / Letter / Legal / custom.
  • Margins: narrow / normal / wide / custom mm.
  • Theme: light / dark / sepia (matches the in-app themes).
  • Header / footer: toggle on/off, set custom text and the page number format.
  • Bookmark depth: include H1–H6, or stop at H3 for a shallower outline.

Defaults are tuned for typical RFC / design-doc reading: A4 / normal margins / light / no header / page number footer / bookmarks to H4.

Headless export from the CLI

mdview export pdf README.md
mdview export pdf README.md -o release-notes.pdf
mdview export pdf README.md --theme dark
mdview export pdf README.md -o - > release-notes.pdf
cat plan.md | mdview export pdf - -o plan.pdf

The CLI uses the same render pipeline as the GUI export and produces an identical PDF. Three flags — -o, --output PATH, --theme NAME, and --no-bookmarks — are documented in the CLI reference. -o - writes the PDF bytes to stdout; you must opt in explicitly because we don’t auto-detect that stdout is redirected.

For CI scripts, exit code 0 means the file was written; 1 covers render failures and missing input; 4 means the running binary doesn’t have a valid Pro license.

Limits and known issues

  • Mermaid diagrams rasterize at the rendered resolution. For very large diagrams, increase the page size before exporting.
  • KaTeX math renders cleanly. Large equation blocks may push the line above their column — adjust margins if it’s tight.
  • Custom CSS isn’t pulled into the export. The PDF uses a print-tuned subset of the in-app theme.
  • Cross-document links to other .md files become text — the exporter doesn’t resolve them across separate PDFs.

Comparison

ToolBookmarksNestedMarkdown-awareNotes
MD View ProYesYesYesNative, no external deps
VS Code previewNonen/aYesBrowser print dialog
TyporaFlat (paid tier only)NoYesTheme-dependent layout
Pandoc + LaTeXYesYesYesHeavy dep, requires LaTeX install
Markdown MonsterFlatNoYes
Print → “Save as PDF”Nonen/an/aFast, no outline

See also

  • DOCX export — if you need .docx instead of PDF.
  • CLI reference — including the mdview export pdf subcommand and its flags.
  • Pricing — $24 lifetime for Pro.