cd /news/artificial-intelligence/getting-two-column-reading-order-rul… · home › topics › artificial-intelligence › article
[ARTICLE · art-151834] src=discuss.huggingface.co ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

Getting two-column reading order, ruled tables and CJK text right when converting PDFs to Markdown for RAG

A practitioner working on PDF-to-Markdown conversion reports that using the open-source pdfplumber and pdfminer.six libraries (both MIT-licensed) to handle two-column reading order, ruled tables and CJK text, then chunking on headings so each chunk retains its section title, improves retrieval for RAG pipelines over PDFs. The approach's stated limits are that it performs no OCR, reading only the existing text layer, and that borderless tables still come out as plain text. The author, who also maintains a paid hosted version as an Apify Actor, asks whether Docling, Marker or pymupdf4llm handle multi-column and CJK documents well and how others deal with borderless tables.

read1 min views1 publishedOct 17, 2026

Many bad RAG answers over PDFs start at extraction, not embeddings. I’ve been working on PDF to Markdown conversion and wanted to share what made the biggest difference, plus a small runnable example.

What breaks with plain text extraction

What worked (pdfplumber + pdfminer.six, both MIT)

Then chunk on headings: each chunk keeps its section title, which helps retrieval a lot.

Limits of this approach: no OCR (it only reads the existing text layer), and borderless tables still come out as text.

Full write-up with a runnable script that builds a two-column sample PDF, shows the broken output, then the fixed Markdown and heading-based chunks:

Disclosure: I also maintain a hosted version of this as a paid Apify Actor (mentioned at the end of the article), but everything above works with the open-source libraries alone.

I’d like to hear what others use. Have Docling, Marker or pymupdf4llm handled multi-column and CJK documents well for you, and how do you deal with borderless tables?

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @pdfplumber 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/getting-two-column-r…] indexed:0 read:1min 2026-10-17 · —