Urgent.News

What's breaking now, across thousands of outlets.

Tech

PDF to Clean Text or Markdown: 3 Free Commands I Tested (and Where Each Breaks)

Full disclosure: I make PDF Insight, a web app that does PDF → text/summary. This post is mostly about the free command-line options, because for a lot of jobs they're all you need. I'll say where each one breaks, including mine. The short version Plain text, fast: pdftotext -layout file.pdf out.txt (Poppler). Keep -layout on or table rows fall apart. Markdown with headings, in Python:…

There are three free command-line options for converting PDFs to clean text or Markdown. The first is pdftotext from Poppler, which preserves visual layout but struggles with tables, often splitting cells onto separate lines. Adding the -layout option helps keep table rows together. However, pdftotext has issues with ligatures like "flat," which can become "flat" and break searches. Normalizing text with unicodedata.normalize() can fix this.

The second option is pymupdf4llm, a Python library that creates Markdown with proper headings (# / ##) and fixes ligatures. However, it sometimes flattens tables into a single line, so tables should be manually verified. This tool is best for feeding documents to LLMs or chunking for Retrieval-Augmented Generation (RAG), but headings are essential for this purpose.

Scanned PDFs pose a challenge since pdftotext can't handle them without OCR. Using ocrmypdf to first add text layers to images before running pdftotext can help. After OCR, the same pdftotext process works as with regular PDFs.

For those who prefer not to script, hosted tools like ChatPDF, NotebookLM, or PDF Insight offer quick PDF-to-clean-text conversions and AI-generated summaries. PDF Insight, developed by the reporter, handles complex layouts and tables well, providing Markdown output and AI summaries. A free plan allows one PDF conversion, with paid options for unlimited use. Always review hosted tool privacy policies before uploading sensitive PDFs.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Strange Times Make for Strange Bedfellows

Mark Zuckerberg, on X: Muse Spark Open — weights releasing today — runs great on new Mac Studios thanks to work with @johnternus and Apple. John Ternus, replying : Congrats to the team!

All the news about the iPhone Duo

Apple has finally announced its long-rumored foldable: the iPhone Duo. The new phone has a 5.4-inch outer display and a 7.6-inch inner display, a “nano‑texture” finish on the inner screen, and barely…

More from Friday 16 October →