mdpdf

Convert Markdown to PDF with a self-contained Rust binary via CLI or Node.js.
Features
- Convert Markdown to PDF using Typst
- Self-contained (no large external dependencies)
- Cross-platform support (x86_64 and aarch64)
- Node.js bindings via napi-rs
- Syntax highlighting for code blocks
Example Output
Usage
Basic Usage
CLI
mdpdf README.md -o README.pdf
Node.js
npm install @mdpdf/mdpdf
# or
yarn add @mdpdf/mdpdf
# or
pnpm add @mdpdf/mdpdf
import { markdownToPdf } from "@mdpdf/mdpdf";
const pdfBytes = await markdownToPdf("# this is markdown");
Development
CLI
cargo build --release --features cli
cargo test
Node.js
npm run build
npm run test