markdown2pdf
converts Markdown documents to PDF
TLDR
SYNOPSIS
markdown2pdf (-p file | -s string | -u url) [-o output] [options]
DESCRIPTION
markdown2pdf converts Markdown documents to PDF. The prominent implementation is a pure-Rust transpiler that renders directly to PDF via printpdf, without an intermediate HTML step and without external dependencies like Pandoc or wkhtmltopdf.Input is provided through one of the -p (file), -s (string), or -u (URL) flags rather than as a bare positional argument. Styling is controlled by built-in themes (--theme) and a TOML configuration file (-c), with individual values overridable via -V.
PARAMETERS
-p file
Read Markdown from the given file.-s string
Read Markdown from the given string.-u, --url url
Fetch Markdown from a URL (requires the fetch feature).-o file
Output PDF path (default: ./output.pdf).--theme name
Use a built-in theme such as github or academic.--page-numbers
Add page numbers to the output.-c file
Load settings from a TOML configuration file.-V key=value
Override a single configuration value.--dry-run
Show what would be rendered without writing a PDF.--print-effective-config
Print the merged configuration and exit.--verbose
Enable verbose output.--quiet
Suppress non-error output.
CAVEATS
Multiple unrelated tools share the markdown2pdf name (Rust, Node.js, and Python variants); flags differ between them. This page documents the Rust implementation. Unlike HTML-based converters, it does not accept arbitrary CSS; appearance is theme- and config-driven.
HISTORY
The Rust markdown2pdf crate was created by theiskaa and is distributed on crates.io. It can be installed with `cargo install markdown2pdf` or via a Homebrew tap.
SEE ALSO
pandoc(1), wkhtmltopdf(1)
