cd /news/ai-tools/convert-a-pdf-to-markdown-with-miner… · home › topics › ai-tools › article
[ARTICLE · art-174694] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

Convert a PDF to Markdown with MinerU from the command line

A developer demonstrated converting PDFs to Markdown using MinerU's command-line parser, then wrapping the command in cmdbook to give it a form-based GUI. The MinerU parse command preserves headings and tables, with flags controlling page ranges, quality tiers and wait timeouts; two pages took about 4.5 seconds on a Mac at the standard tier. The cmdbook wrapper turns the PDF path, tier and page range into prompt placeholders that render as a dropdown and defaults.

key takeaway

MinerU's 'mineru parse' command preserves PDF headings and tables in Markdown output, but you must set --pages and --wait explicitly, since omitting them limits output to the first 10 pages and stops waiting after 60 seconds.

by read2 min views1 publishedNov 23, 2026

You have a PDF report and want it as Markdown: for your notes, or to give to an AI.

How do you do it?

You copy and paste from the PDF viewer. The headings turn into plain lines, and the tables turn into rows of numbers with no columns.

You ask an AI, and it points you to MinerU, which reads the layout and keeps headings and tables. You install it, start its server, and find the command:

mineru parse report.pdf --tier standard --pages 1-10 -o report.md --wait 600

Every flag matters. Leave out --pages and you only get the first 10 pages. Leave out --wait and a long document stops waiting after 60 seconds. --tier trades speed for quality.

You save it somewhere: a Markdown note, or a pdf2md.sh file. Next time it's another PDF, or pages 20 to 40, or a faster tier, and you have to find the command and edit it.

With cmdbook, the command has one place to live, and it gets a GUI for free.

1. Save the command once. Create a command in cmdbook and paste the script (it's at the end).

2. Mark what changes. The PDF, the tier and the pages become placeholders:

IN="{{prompt:pdf}}"
--tier {{prompt:tier?standard|flash|basic|advanced}} --pages {{prompt:pages?1-10}}

standard|flash|basic|advanced becomes a dropdown. ?1-10 is the default.

3. Click Run. cmdbook shows a form. Drag the PDF onto it, pick a tier, set the pages, press Enter.

4. Read the Markdown. It's saved next to the PDF and printed in the output panel, tables included:

## 3. Monthly figures

| Month | Requests (M) | Median latency (ms) | p95 latency (ms) | Error rate | Availability |
| --- | --- | --- | --- | --- | --- |
| July | 41.2 | 198 | 612 | 0.31% | 99.97% |
| August | 44.8 | 181 | 570 | 0.42% | 99.91% |
| September | 48.6 | 164 | 503 | 0.27% | 99.99% |

Two pages took about 4.5 seconds on my Mac at the standard tier.

Next time, your last tier and pages are already filled in.

That's all a script needs to get a GUI: mark the parts that change. The rest is the command you already have.

Try cmdbook here: printf.app/cmdbook

The full script (needs MinerU, with its server running)

IN="{{prompt:pdf}}"
OUT="${IN%.*}.md"
MINERU_LANG=en mineru parse "$IN" \
  --tier {{prompt:tier?standard|flash|basic|advanced}} --pages {{prompt:pages?1-10}} \
  -o "$OUT" -v --wait 600 && cat "$OUT"
── more in #ai-tools 4 stories · sorted by recency
── more on @mineru 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/convert-a-pdf-to-mar…] indexed:0 read:2min 2026-11-23 · —