--- id: pdftext version: "0.7.1" license: Apache-2.0 license_treatment: permissive maintenance: active --- # pdftext — Extract structured text from pdfs quickly License: permissive · Maintenance: active · Downloads: 555.4K/mo ## What it is and what it does PDFText is a Python library and CLI tool that extracts text from PDFs in plain-text or structured JSON format, grouping content into pages, blocks, lines, and spans with font metadata and bounding boxes. It wraps pypdfium2, a fast and accurate PDF rendering library, and offers an Apache-licensed alternative to PyMuPDF for extraction tasks that do not require AGPL compliance. You can use it as a command-line tool to convert PDFs to text files or JSON, or call its extraction functions directly from Python code. It supports encrypted PDFs, page ranges, parallel extraction via process workers, and optional reading-order sorting. The library handles CJK, Cyrillic, Greek, and other left-to-right scripts correctly; right-to-left scripts are returned in the order pdfium reports them, which may differ from logical reading order. Use it for: - Batch convert PDFs to plain text or JSON for downstream NLP and document analysis pipelines. - Extract structured block and line data with font info and bounding boxes for document layout analysis or OCR-free text mining. - Parse encrypted PDFs with password support in automated workflows. - Extract text from specific page ranges or use parallel workers to speed up extraction on large document collections. - Build a PDF text extraction service that avoids AGPL licensing constraints of PyMuPDF. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Extracts plain text or structured blocks, lines, and spans from PDFs via a command-line tool or Python API, built on pypdfium2 with Apache licensing. Yes. Active maintenance, low install friction, Apache licensing, no known vulnerabilities, and strong extraction accuracy (97.54% alignment vs. PyMuPDF on benchmarks) make this a solid choice for PDF text extraction. Install if you need structured extraction with font metadata, want to avoid AGPL, or prefer pypdfium2's architecture. Not suitable if you require right-to-left bidi reordering or need thread-safe extraction without process workers. ## Install pip install pdftext uv add pdftext poetry add pdftext ## Installing pdftext Before you install: Low friction: pure Python wheel with five runtime dependencies (click, numpy, pydantic, pydantic-settings, pypdfium2). Active maintenance, last commit 2026-07-08, 716 repository stars. Requires Python 3.10 or later. License in practice: Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions—no copyleft obligations or AGPL concerns. Quickstart: pip install pdftext from pdftext.extraction import plain_text_output text = plain_text_output('document.pdf', sort=False, hyphens=False) Requires Python 3.10 or later. pypdfium2 is not thread-safe; use the built-in workers= option for parallelism or process pools, not threads. Verify before relying: - Whether the 97.54% alignment score vs. PyMuPDF holds across diverse real-world PDF types beyond the 200-document benchmark set. - Performance characteristics on very large PDFs (hundreds of pages) with the workers= option. - Completeness of right-to-left script handling compared to PyMuPDF's bidi reordering for Arabic and Hebrew documents. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 555.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pdf text extraction, extract text from pdf, structured pdf parsing, pdf to text converter, pdf content extraction, pdf block and line extraction, pypdfium2 wrapper, pdf-extraction, text-mining, document-parsing [View on SkillFed](https://skillfed.io/packages/pdftext) · [View on PyPI](https://pypi.org/project/pdftext/)