Convert Markdown to PDF with Mermaid diagrams, KaTeX math, Obsidian syntax, syntax highlighting, batch processing, and Table of Contents generation. Available as a CLI and Node.js API.
# Install globally (for CLI usage)
npm install -g @amitdevx/md2pdf
md2pdf init
# Or use locally within a project (for programmatic usage)
npm install @amitdevx/md2pdf
npx md2pdf initFor more details on installation and setup, see the Getting Started guide.
The most common way to use md2pdf is via the command line.
md2pdf document.mdThis will automatically generate document.pdf in the same directory.
Note: All documentation for
md2pdfhas been moved to thedocs/directory.
- Getting Started : Installation and quick start guide.
- CLI Reference : Command-line flags, options, and usage examples.
- API Reference : Node.js programmatic API documentation.
- Configuration : Persistent config files and profiles.
- Themes : Using and customizing built-in themes.
- Plugins : Extending md2pdf via the plugin API.
- Obsidian Support : Guide to Obsidian features (callouts, embeds, wiki-links).
- Mermaid & Math : Using Mermaid diagrams and KaTeX math blocks.
- Architecture : Internal design, caching, and pipeline details.
- Contributing : Guidelines for contributing to md2pdf.
MIT License. See LICENSE for details.