Markdown to PDF: Three Tool Runs, Verbatim Outputs, Zero Invented Numbers

One Markdown test file — six stress points: H1/H2 headings, bold, code span, a link, a bullet list, a 2-row table, a blockquote — pushed through three pipelines we actually ran in a Linux sandbox. Verdict: pandoc + WeasyPrint produced the only properly typeset output (lined table, real bullet dots, blockquote bar). WeasyPrint alone rendered the content but lost three pieces of styling: its bullets came through as bare bullet glyphs detached from text, its blockquote printed as plain text with no bar, and its table came out cramped. Chromium headless duplicated the title (browser title bar + document heading both rendered) and stamped a date/URL/「1/1」header-footer onto the page. Our default first attempt — bare pandoc file.md -o out.pdf — failed outright: pdflatex not found, exit 47. That failure is a finding too: pandoc's \emph{default} PDF path requires LaTeX, and if you don't have it, you must pick another engine.

Day 9 of our 28-day series, and the reverse direction of yesterday's page: yesterday we converted PDF→Markdown (we ran pdfminer.six, pdfplumber, pymupdf4llm); today we go Markdown→PDF. Same rules as always on this site: everything below comes from a run executed today; quoted outputs are verbatim; tools we didn't run are labeled not run with the reason; there are no accuracy percentages and no price tags anywhere.

The test file (reproduce it in 60 seconds)

# Q3 Sample Report
Intro paragraph explaining the **quarterly results**, with `code span` and a [link](https://example.com).

## 1. Overview
- Revenue grew 12% year over year
- Costs declined by 3%

| Region | Q3 Rev | Growth |
|---|---|---|
| North America | $1.2M | +10% |
| Europe | $0.8M | +14% |

> Note: figures are unaudited.

Why these six elements: headings and bold test typography; the code span and link test inline treatment; the bullet list tests list semantics; the pipe table tests layout (the hardest part of Markdown→PDF); the blockquote tests whether the renderer even implements the element. All born-digital, zero OCR risk — any miss below is a rendering miss.

The comparison table — three pipelines we ran

PipelineStatusHeadingsListTableBlockquoteExtra artifactsVerdict from our run
Bare pandoc (default engine) Actually run — failed: pdflatex not found… exit=47 No output produced. If you hit this, either install a TeX distribution or pass another --pdf-engine. We took the second door (next row).
pandoc → WeasyPrint (--pdf-engine=weasyprint) Actually run — success, output quoted below and rendered for visual check H1/H2 rendered at distinct sizes Real bullets (•) attached to each item Proper lined table — header rule + body rule, columns aligned Blockquote bar rendered (vertical line, gray text) None — clean single page, no header/footer junk Best of the three; looks like a document, not a debug print
WeasyPrint alone (markdown lib → HTML → PDF) Actually run — success, output quoted below H1/H2 rendered Bullets rendered — smaller markers sitting tight against the text, no list indent depth No rules at all: content intact, header bold, but zero lines between rows or around cells — columns only readable by eye No bar — indented slightly, otherwise plain text None Content survived, presentation did not. Usable for draft review, not for shipping
Chromium headless (--print-to-pdf from pandoc HTML) Actually run — success, output quoted below Title duplicated: the HTML <title> printed as a header AND the H1 printed again as a heading Bullets rendered correctly Properly aligned with rules Rendered Yes, 3 kinds: a date-time/page header, a file:///mnt/work/… URL footer, and a 「1/1」page number — none of which belong in a document Fast, but the junk artifacts make it look unfinished without extra flags/overrides

Run 1: bare pandoc — the failure, verbatim

$ pandoc test_md.md -o out.pdf
pdflatex not found. Please select a different --pdf-engine or install pdflatex -- see also /usr/share/doc/pandoc/README.Debian
(exit code 47)

You will read plenty of tutorials that start with that exact command. In a standard environment without a TeX distribution, it does not work. Two clean fixes: install a TeX distro (hundreds of MB), or route through an engine you already have — which is what we did next.

Run 2: pandoc + WeasyPrint — verbatim extracted text and what the render looked like

Q3 Sample Report

Intro paragraph explaining the quarterly results, with code span
and a link.

1. Overview

• 
• 

Revenue grew 12% year over year
Costs declined by 3%

Region

Q3 Rev Growth

North America $1.2M +10%

Europe

$0.8M +14%

Note: figures are unaudited.

Read that with the caveat the text extractor applies: pdfminer reads a PDF left-to-right, top-to-bottom, and flattens positioned glyphs — the bullets showing as lone • characters with the text lines following are an extraction-order artifact, not a rendering bug; the actual rendered PNG shows proper bulleted lines. The same applies to the table: extraction shows atoms in isolation, but the rendered page shows a genuinely aligned table. This is exactly why we rendered each PDF to an image and looked at it before making claims. The visual render confirmed: aligned column rules, real bullet dots at the correct indent, a visible left bar on the blockquote, heading sizes stepping down cleanly. The only content-level casualty was the [link] — it kept its underline styling, and the URL itself is an href, not visible text, which is standard.

Run 3: WeasyPrint alone (markdown→HTML→PDF in one Python script) — verbatim

Q3 Sample Report

Intro paragraph explaining the quarterly results, with code span and a link.

1. Overview

• 
• 

Revenue grew 12% year over year
Costs declined by 3%

Q3 Rev Growth

Region
North America $1.2M +10%
$0.8M +14%
Europe

Note: figures are unaudited.

Bullets actually came through fine at render time — the lone • glyphs in the extraction above are again a flattening artifact (the rendered PNG shows each bullet tight against its item). The real losses, confirmed visually against Run 2's render: the table printed with zero ruling lines (header bold but nothing separating rows or cells), and the blockquote printed as slightly-indented plain text with no left bar. The cause is not the PDF engine — it's the HTML in between: pandoc produces a full standalone HTML document with its own CSS that styles blockquotes and tables; a one-liner markdown.markdown(md) produces bare HTML fragments with no stylesheet, so WeasyPrint printed unstyled content. Lesson that came out of this run: if you use WeasyPrint directly, your input HTML quality carries all the styling; WeasyPrint itself computed positions perfectly.

Run 4: Chromium headless — verbatim, with the junk in place

10/23/26, 10:57 PM

Q3 Sample Report

Q3 Sample Report

Intro paragraph explaining the quarterly results, with code span and a link.

1. Overview

Revenue grew 12% year over year
Costs declined by 3%

Region

Q3 Rev Growth

North America

$1.2M +10%

Europe

$0.8M +14%

Note: figures are unaudited.

file:///mnt/work/md_chromium.html

1/1

This run has no extraction-order excuse: the duplicated title is real (we passed --standalone --metadata title="Q3 Sample Report", so pandoc rendered the title, and the document's own H1 added a second one). So are the timestamp header, the file:// footer, and the page counter — Chromium's --print-to-pdf defaults to print decorations. Both problems have known, non-guessed fixes (don't duplicate the title in metadata; pass --no-header/--no-footer or add a print stylesheet), but as-run, the output ships with junk a document shouldn't have. We report it as-run, per our own comparison rule.

What we could NOT test — and refuse to guess

- Typst / LaTeX-oriented converters — not run. Reason: the sandbox has no TeX LaTeX distribution and installing one costs several hundred megabytes purely to score a single row of a table; that is not a verdict against the tool, it is us declining the setup.

- Commercial online converters (Adobe online, iLovePDF, etc.) — not run. Reason: they require account signup on third-party services and we have no account in this test bench; every claim in our comparison pages is limited to tools we executed.

- Everything not named in the table above — not run. If a tool is missing from this page, that is the reason: we have not executed it, and we do not publish untested ratings.

Decision rule this run actually supports

- You want output that looks like a document today: pandoc + WeasyPrint, one command, no extra setup; it was the only one of our four runs that produced nothing to clean up.

- You're already in Python and want full control: WeasyPrint alone works but you must bring a stylesheet — bare HTML in means unstyled PDF out (that's what Run 3 proved).

- You live in the browser anyway and need speed, not polish: Chromium headless converts in seconds, but budget for the header/footer/title-duplication cleanup.

- Confidential content: all three pipelines ran 100% locally in our sandbox — same privacy guarantee as our Markdown to PDF workflow guide, which covers the plain conversion steps when you don't care about tool choice.

Quick FAQ

Why is pandoc's default path broken?

Because its default --pdf-engine assumes pdflatex, and pandoc doesn't ship a TeX distribution. If the command fails with "pdflatex not found", that's expected on most machines — add --pdf-engine=weasyprint (or wkhtmltopdf, or tectonic) — which is what we did.

Why did WeasyPrint-alone render "worse" than pandoc+WeasyPrint if the engine is the same?

Because pandoc's standalone HTML carries default CSS (tables, blockquotes, headers); our one-liner HTML had none, so the engine rendered unstyled input. The lesson: engine choice matters less than input HTML quality.

Can I reproduce your runs?

Yes: pandoc test.md -o out.pdf --pdf-engine=weasyprint; python -c "import markdown, weasyprint; …"; chromium --headless --print-to-pdf=out.pdf page.html. If your document has footnotes, images, or footers, expect differences — that's the point of the 90-second self-test on your own file.

Yesterday we went the other direction (PDF→Markdown, three tools run). Tomorrow in the series: the next adjacent reader workflow. Bookmark pdf2mdtool.com and follow along.