Skip to content
Edit this page

KurdPDF

KurdPDF: correct Central Kurdish text from any PDF

Get correct Central Kurdish (Sorani, ckb) text out of PDFs. · دەقی کوردی بە دروستی لە PDF دەربهێنە.

Copying text from many Kurdish PDFs gives Latin gibberish (†òÔð ØíІñ instead of دەقی کوردی), reversed or disconnected letters, or empty boxes. The cause is the fonts: legacy Latin-mapped fonts (Ali-K, Ali-A and others), presentation-form text, broken ToUnicode maps, opaque Type 3 fonts, and scanned pages. KurdPDF inspects every font in the PDF, identifies glyphs by their outlines with HarfBuzz, and picks the right way to recover each one. Everything runs on your computer.

Copied from the PDF: Latin gibberish. Read by KurdPDF: دەقی کوردی دروست

Quick start

uv tool install kurdpdf                  # or: pipx install kurdpdf (Python 3.14+)
kurdpdf inspect book.pdf                 # which fonts, which classes, which pages are scanned
kurdpdf book.pdf                         # writes book.txt next to the PDF
kurdpdf book.pdf --format docx,odt,md --out out/
kurdpdf web                              # the page editor and reader in your browser
from kurdpdf import KurdPDF

doc = KurdPDF("book.pdf").extract()
print(doc.pages[0].best_text())

What it handles

  • Every kind of broken Kurdish PDF: legacy fonts (Ali-K, Ali-A, Zanest, and the Halabja family), wrong or missing ToUnicode maps, presentation forms in visual order, separate dot and mark glyphs, Windows printer-driver fonts, and scanned pages (OCR with Tesseract).
  • Checked, not guessed: each page is shaped again with HarfBuzz and compared with the glyphs drawn; look-alike letters are settled with a Sorani word list you import; glyphs nothing can read are reported, never invented.
  • Nine formats: TXT, Markdown, DOCX, ODT, RTF, HTML, LaTeX, EPUB and JSON (with a JSON Schema), with right-to-left paragraphs and language tags.
  • Page structure: paragraphs, headings, lists and ruled tables; two-column and two-page spreads read in order.
  • Faithful layers: the raw and resolved text stay as the PDF draws it; a separate orthography layer normalizes only Kurdish lines, and every rule can be turned off.

Where next

  • Install: uv, pipx or a plain virtual environment, fonts for exported files, OCR.
  • Playground: the kurdpdf web page in your browser, nothing uploaded; or the same page with OCR in Docker (docker run -p 127.0.0.1:8765:8765 ghcr.io/kanilabs/kurdpdf) or with uvx kurdpdf web.
  • Usage: converting, page tools, batches, the web page, glyph review, Python.
  • Fonts and the glyph atlas: the font classes and how each is recovered.
  • AI agents: the ckb-pdf-to-text skill for Claude Code, Codex, Cursor, Gemini CLI and Copilot.
  • About: the story, the name and the logo.
  • The full manual ships with the program: kurdpdf manual.

KurdPDF is free software under the GPL-3.0-or-later.