go · CLI + library

Write Markdown.
Ship a beautiful PDF.

pretty-pdf turns a folder of Markdown into a typeset, print-ready PDF — or EPUB — via headless Chrome. No LaTeX, no design tools, nothing to install but a binary.

$ go install github.com/sazardev/go-pretty-pdf/cmd/pretty-pdf@latest
Read the docs →
book/ — pretty-pdf build

How it works

Three steps between a folder of notes and a finished book.

01 — Write

Plain Markdown, plain frontmatter

.md, .mdx, or even bare .txt — missing frontmatter gets an id/title generated from the filename automatically.

---
id: "[1.0.0]"
title: Getting Started
---

# Getting Started

02 — Configure

Pick a theme, a trim size, a cover

17 built-in themes, custom paper dimensions for print-on-demand, and a cover image — all from one config file.

theme: gruvbox
paper: 6x9in
cover_image: cover.svg

03 — Ship

One command, two formats

A quality audit checks for overflow, broken images, and clipped headings before you ever open the file.

$ pretty-pdf build \
    --format pdf,epub

Everything a real book needs

Built for print, not just for screens.

Every feature below ships in the core binary — no plugins, no paid tier.

01

17 built-in themes

From clean & minimal to Gruvbox, LaTeX-style academic papers, and government letterhead.

02

PDF + EPUB, one source

Build both formats from the same Markdown in a single pass — no separate pipeline to maintain.

03

Print-ready trim sizes

6×9in, A5, or exact mm/in dimensions — the sizes real print-on-demand services expect.

04

Syntax highlighting

Fenced code blocks are highlighted via Chroma, with a palette matched to your theme.

05

Auto TOC & bookmarks

Table of contents and PDF bookmarks are generated straight from your headings.

06

Automatic quality audit

Catches overflow, broken images, low-contrast text, and clipped headings before you do.

07

Custom components

<DeepDive>, <Warning>, <Axiom> — or register your own in Go.

08

Live reload

watch and serve rebuild on save, with the browser refreshing instantly.

09

Write however you want

Even a stray .txt file gets folded in — auto-numbered, auto-titled, zero setup.

The CLI

Every command, right at your fingertips.

The whole tool is one binary with a handful of commands — everything below works on Linux, macOS, and Windows.

pretty-pdf init my-bookScaffold a book: skeleton MDX + config.
pretty-pdf buildRender a print-ready PDF (and EPUB with --format pdf,epub).
pretty-pdf checkValidate source only — no Chrome needed.
pretty-pdf epubBuild an EPUB 3, no Chrome required.
pretty-pdf serveLive HTML preview with live reload.
pretty-pdf watchRebuild the PDF on every save.
pretty-pdf theme listBrowse 17 built-in themes or add your own.
pretty-pdf completionShell completions for bash, zsh, fish.

Full CLI reference →

Themes — try one

17 palettes. Same Markdown.

This page is skinned with the exact same tokens as the real themes — click one, the whole site follows.

default
professional
minimal
minimal
modern
professional
classic
editorial
corporate
professional
dark
dark
academic
academic
editorial
editorial
sepia
warm
terminal
technical
blueprint
technical
ivy
institutional
government
institutional
resume
resume
legal
formal
latex
academic
gruvbox
technical

Currently previewing default — this is exactly what your book's cover, headings, and code blocks would use. Download this page's docs in this theme →

Why not LaTeX?

Typesetting without the tradeoffs.

 LaTeXDesign apppretty-pdf
Plain text, git-diffableYesYes
Runs headless in CIYesYes
Learning curveSteepSoftware-specificJust Markdown
Print-ready trim sizesManualManualBuilt in
Free & open sourceYesUsually notMIT licensed

Measured, not estimated

A 3,000-doc book — print-ready in ~23 seconds.

Real books rendered end-to-end: parse, validate, compose, Chrome print, and the quality audit are all inside the wall time. Reproducible on your own machine — full methodology and every size in BENCHMARKS.md.

Source docsValidationEPUBPDF pagesPDF wall timeThroughput
10030 ms27 ms1210.57 s211 pages/s
1,00062 ms88 ms1,1802.99 s394 pages/s
3,000142 ms248 ms3,53523.02 s154 pages/s

Full methodology & all sizes →

17built-in themes
2output formats
0LaTeX or design tools
100%free & MIT licensed

FAQ

Frequently asked questions

Straight answers about how go-pretty-pdf works, what it needs, and what it can build.

Does go-pretty-pdf require LaTeX?

No. PDFs are rendered from Markdown/MDX via headless Chrome — no LaTeX, no separate design tool, nothing to install but the binary.

Does it require a manual Chrome install?

Usually not. On first render, chromemgr auto-downloads a headless Chrome build if no system Chrome or --chrome-path is found. Only on linux/arm64 you must provide Chrome yourself.

Can I build an EPUB without Chrome?

Yes. The epub command builds EPUB 3 output from the same Markdown with no Chrome or Chromium required.

What input file formats are supported?

.md, .mdx, and even bare .txt files. Documents are ordered by their [X.Y.Z] frontmatter id, not by filename.

How many themes are built in?

17 themes — from minimal and modern to Gruvbox, LaTeX-style academic, corporate, and government letterhead — plus a custom .theme.yml system and per-theme color/font overrides.

Can I build PDF and EPUB from one source?

Yes. A single command (--format pdf,epub) builds both from the same Markdown in one pass — no separate pipeline.

Is it fast on big books?

Yes. A 3,000-document book validates in 142 ms and renders a 3,535-page PDF in ~23 s on a mid-range i5. The Go-side pipeline stays sub-second at every size — see BENCHMARKS.md for the reproducible methodology.

Is go-pretty-pdf free?

Yes — MIT licensed, open source, no paid tier. Every feature ships in the core binary.

Read the full documentation →