What problem does it solve?
Converts Markdown documents into professionally styled, print-ready PDF files while preserving complex content such as Mermaid diagrams, LaTeX math, tables, and syntax-highlighted code so users do not need to manually reformat or rebuild documents for distribution.
Core Features & Use Cases
- High-fidelity rendering: Full pipeline that renders Mermaid diagrams to SVG, converts Markdown to HTML via pandoc, performs server-side KaTeX math rendering, injects professional CSS, and prints to PDF via Playwright/Chromium.
- Flexible export options: Supports page sizes (A4/Letter/Legal/A3), custom margins, landscape orientation, header/footer page numbers, custom CSS injection, and flags to skip Mermaid or math rendering for speed.
- Use Case: Turn technical notes, research drafts, or documentation containing diagrams and equations into a single, publication-quality PDF without manual layout work.
Quick Start
Run the conversion using the included script, for example: python3 scripts/md_to_pdf.py input.md output.pdf