{"slug": "getting-two-column-reading-order-ruled-tables-and-cjk-text-right-when-converting", "title": "Getting two-column reading order, ruled tables and CJK text right when converting PDFs to Markdown for RAG", "summary": "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.", "body_md": "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.\n\n**What breaks with plain text extraction**\n\n**What worked (pdfplumber + pdfminer.six, both MIT)**\n\nThen chunk on headings: each chunk keeps its section title, which helps retrieval a lot.\n\nLimits of this approach: no OCR (it only reads the existing text layer), and borderless tables still come out as text.\n\nFull 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:\n\nDisclosure: 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.\n\nI’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?", "url": "https://wpnews.pro/news/getting-two-column-reading-order-ruled-tables-and-cjk-text-right-when-converting", "canonical_source": "https://discuss.huggingface.co/t/getting-two-column-reading-order-ruled-tables-and-cjk-text-right-when-converting-pdfs-to-markdown-for-rag/190697#post_1", "published_at": "2026-10-17 08:21:25+00:00", "updated_at": "2026-10-17 08:33:14.503409+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-tools", "developer-tools"], "entities": ["pdfplumber", "pdfminer.six", "Docling", "Marker", "pymupdf4llm", "Apify"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/getting-two-column-reading-order-ruled-tables-and-cjk-text-right-when-converting", "markdown": "https://wpnews.pro/news/getting-two-column-reading-order-ruled-tables-and-cjk-text-right-when-converting.md", "text": "https://wpnews.pro/news/getting-two-column-reading-order-ruled-tables-and-cjk-text-right-when-converting.txt", "jsonld": "https://wpnews.pro/news/getting-two-column-reading-order-ruled-tables-and-cjk-text-right-when-converting.jsonld"}}