mpe2pdf
v0.3.0
Published
Convert Markdown to PDF via mume + Prince, matching VS Code Markdown Preview Enhanced output
Readme
mpe2pdf
Convert Markdown to PDF using the Markdown Preview Enhanced engine (mume) and Prince.
The output matches what you see in VS Code's Markdown Preview Enhanced extension — including Mermaid diagrams, KaTeX math, syntax-highlighted code blocks, tables, task lists, and footnotes.
Prerequisites
Installation
npm install -g mpe2pdfOr run directly with npx:
npx mpe2pdf input.mdUsage
mpe2pdf input.md # produces input.pdf
mpe2pdf input.md output.pdf # explicit output path
mpe2pdf ch1.md ch2.md ch3.md # batch: produces ch1.pdf, ch2.pdf, ch3.pdfOptions
| Flag | Description |
|---|---|
| --help | Show usage information |
| --help-agent | Show usage + agent integration guide |
| --version | Print version number |
How it works
- mume renders the Markdown to HTML with full GFM support, Mermaid diagrams, and math rendering — the same pipeline as VS Code Markdown Preview Enhanced.
- Prince converts the HTML to a typeset PDF.
Security
mpe2pdf runs with script execution enabled in the mume engine, so embedded scripts in Markdown files will execute. Only convert files you trust.
Agent integration
If you use an agentic coding tool, run mpe2pdf --help-agent or include
agents-guide.md in your project context.
License
Apache 2.0 — see LICENSE.
