pdfminer

pdfminer.six is a pure Python tool for extracting information from PDF documents, focused on text data analysis — it recovers text plus its position, font, and color, and can also pull images, forms, and outlines.

20260107
Published at
Jan 7, 2026
7,039
Stars
1,446
Download
Synced at
8d ago

Latest release

20260107Jan 7, 2026, 01:29 PM
Downloads slow? Switch the source anytime above

README

Project Overview

pdfminer.six is a community maintained fork of the original PDFMiner for extracting information from PDF documents, with a focus on getting and analyzing text data. It pulls page text directly from the PDF's internal structure and can also recover exact position, font, and color of each string; the codebase is modular so every component can be swapped for custom pipelines.

Item Value
Platform cross-platform (pure Python)
Language Python 3.10+
License MIT
CLI tool pdf2txt.py

Mine text, positions, fonts, and colors out of PDFs in pure Python.

Key Features

  • Text extraction: parses the PDF internals to pull text straight off pages
  • Layout analysis: automatically analyzes layout, reporting position, font, and color
  • Multiple outputs: export content as text, HTML, or hOCR
  • Image extraction: pulls embedded JPG, PNG, TIFF, and JBIG2 images
  • CJK and vertical writing: supports Chinese, Japanese, Korean, and vertical text
  • Encrypted documents: decrypts PDFs protected with RC4 or AES
  • Form extraction: reads AcroForm interactive form data
  • Outline extraction: recovers the table of contents and tagged contents

Target Audience

  • Document automation and RPA developers
  • Engineering teams digitizing archives and analytics data
  • Internationalization projects handling multilingual PDFs
  • Developers building their own PDF parsing components

Quick Start

  1. Install
pip install pdfminer.six
  1. Extract text from the command line
pdf2txt.py example.pdf
  1. Call the high-level API in code
from pdfminer.high_level import extract_text

text = extract_text('example.pdf')
print(text)
  1. Install the extra dependency when images are needed
pip install 'pdfminer.six[image]'

Core Advantages

  • Pure Python: no system-level PDF library needed, deployment stays simple
  • Deep detail: beyond raw text, positions, fonts, and colors are available
  • Modular design: parsing, interpretation, and rendering components are independently replaceable

System Requirements

Item Requirement
Language Python 3.10 or newer
OS cross-platform
Optional deps image extra required for picture extraction

Notes

  • Scans do not work: image-only scanned PDFs have no text layer and need OCR alongside
  • Complex layouts need tuning: tables and multi-column pages may require custom layout analysis

Release history

Sort