doc-to-pdf
One command from a Markdown or HTML file to a presentation-grade PDF. Uses headless Chrome's --print-to-pdf (best-fidelity HTML→PDF on a normal machine) and wraps your content in a consistent brand template so every client deliverable matches.
When to use
- Turning a Markdown brief or an HTML page into a client-ready PDF
- Producing a branded workflow/roadmap/proposal document
- Any "send them a PDF" moment where it should look intentional
How it works
- Markdown input → HTML (python-markdown, falling back to pandoc, then a minimal converter).
- HTML input → used as-is.
- Wraps in the brand template (letter page, print margins, blue accents, footer) unless
--no-brand. - Renders via headless Chrome (
--headless=new --no-pdf-header-footer).
CLI
python3 doc_to_pdf.py <input.md|input.html> [-o out.pdf] [--title "..."] [--no-brand] [--template tpl.html] [--force]
Examples:
python3 doc_to_pdf.py roadmap.md -o "Brothers - Roadmap.pdf" --title "Brothers Composites — Roadmap"
python3 doc_to_pdf.py hub.html --no-brand # already-styled HTML, no wrap
Safety
- Produces a new file; never overwrites an existing PDF without
--force. - No network, no credentials.
- Requires Chrome / Chromium / Edge installed (any one).
See also
- client-delivery — renders deliverables as part of the audit → render → publish pipeline.