pdf-extract

PDF to Markdown

Use DocuShell's Parse PDF API to extract a PDF into the Markdown output variant, with detected headings, tables and ordered lists for RAG indexes or LLM context.

Format facts

Source MIME
application/pdf
Target MIME
text/markdown
Max input size
50 MB
Typical output size
0.02-0.10x input size
Lossy?
Yes, see quirks
Backed by
parse-pdf
Availability
Live public API
Endpoint
POST /api/v1/parse

How the conversion runs

  1. Step 1. POST the PDF to /api/v1/parse with formats=markdown; the API verifies PDF magic bytes and rejects encrypted documents.
  2. Step 2. The parser clusters glyphs into reading-order blocks and scores headings from font size, weight and spacing.
  3. Step 3. Tables are reconstructed from ruling lines when present and from whitespace-column inference otherwise.

API example

curl -X POST https://api.docushell.com/api/v1/parse \
  -H "Authorization: Bearer $DOCUSHELL_API_KEY" \
  -F "[email protected]" \
  -F "formats=markdown"

Submit returns a queued job with job_id. Poll GET /api/v1/jobs/{id}, then download with GET /api/v1/jobs/{id}/download.

Format-specific quirks

  • Scanned PDFs without a text layer return a no_text_layer warning; OCR is a separate workflow.
  • Two-column layouts are reflowed with x-coordinate clustering and may need caller review.
  • Footnote markers are preserved as Markdown references where possible.

Frequently asked questions

Is the output deterministic?

Yes. The serializer uses fixed scoring constants for repeatable Markdown output.

Can I get JSON instead of Markdown?

Yes. Call /api/v1/parse with formats=json to keep bounding boxes and font metadata.

What happens on hostile PDFs?

Oversized or timed-out documents return structured errors so callers can retry smaller slices.

Related conversions