Skip to content

Choose a browser

This guide shows you how to control which Chromium-family browser renders the PDF.

Use automatic discovery

Run the command without --browser:

md-to-pdf fixtures/basic.md

The CLI first looks for Chrome, Chromium, and Microsoft Edge command names on PATH. It then checks common macOS application paths and standard Windows installation folders.

On Windows, it searches ProgramFiles, ProgramFiles(x86), and LOCALAPPDATA, in that order. Within each folder, it checks the usual Chrome, Edge, and Chromium executable locations. These installations do not need to be on PATH; see Browser discovery for the exact paths.

Set a browser path for one command

Pass --browser:

md-to-pdf fixtures/basic.md \
  --browser "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"

Replace the path with the browser executable on your system:

Platform Example browser path
macOS Edge /Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge
Linux Chrome /usr/bin/google-chrome
Windows Chrome C:\Program Files\Google\Chrome\Application\chrome.exe

Set a browser path for a shell session

Set MD_TO_PDF_BROWSER:

export MD_TO_PDF_BROWSER="/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"
md-to-pdf fixtures/basic.md

Use this form in CI when the browser path is known.