Community maintained fork of pdfminer - we fathom PDF
 
 
Go to file
Pieter Marsman 027bb62943 Merge branch 'develop' of github.com:pdfminer/pdfminer.six into develop 2019-11-06 21:51:41 +01:00
.github Add item to checklist about updating CHANGELOG.md 2019-10-22 17:30:09 +02:00
cmaprsrc Fix typos 2016-09-13 16:25:09 +02:00
docs Revert "Move old documentation to subfolder" 2019-10-27 14:26:11 +01:00
pdfminer Fix debug logging for pdf2txt.py and dumppdf.py (#325) 2019-11-06 21:47:19 +01:00
samples Fix failing test on develop & cleaning up test files (#319) 2019-10-26 18:42:33 +02:00
tests Replace opts by argparse in dumppdf.py (#321) 2019-10-27 21:40:04 +01:00
tools Fix debug logging for pdf2txt.py and dumppdf.py (#325) 2019-11-06 21:47:19 +01:00
.gitignore Add tox configuration for easy local testing (#85) 2017-08-18 08:11:32 +02:00
.travis.yml Add new python versions for travis 2019-10-23 21:05:30 +02:00
CHANGELOG.md Merge branch 'develop' of github.com:pdfminer/pdfminer.six into develop 2019-11-06 21:51:41 +01:00
CONTRIBUTING.md Update CONTRIBUTING.md 2019-10-20 14:18:26 +02:00
LICENSE Added: LICENSE 2016-09-11 23:38:18 +09:00
MANIFEST.in Merge remote-tracking branch 'origin/master' 2017-01-19 08:03:16 +01:00
Makefile Merge remote-tracking branch 'origin/master' 2017-01-19 08:03:16 +01:00
README.md Added: extraction of JBIG2 encoded images (#311) 2019-10-22 17:37:06 +02:00
setup.py Only define dependencies in setup.py (#306) 2019-10-20 11:41:31 +02:00
tox.ini Only define dependencies in setup.py (#306) 2019-10-20 11:41:31 +02:00

README.md

PDFMiner.six

PDFMiner.six is a fork of PDFMiner using six for Python 2+3 compatibility

Build Status PyPI version

PDFMiner is a tool for extracting information from PDF documents. Unlike other PDF-related tools, it focuses entirely on getting and analyzing text data. PDFMiner allows one to obtain the exact location of text in a page, as well as other information such as fonts or lines. It includes a PDF converter that can transform PDF files into other text formats (such as HTML). It has an extensible PDF parser that can be used for other purposes than text analysis.

Features

  • Written entirely in Python.
  • Parse, analyze, and convert PDF documents.
  • PDF-1.7 specification support. (well, almost).
  • CJK languages and vertical writing scripts support.
  • Various font types (Type1, TrueType, Type3, and CID) support.
  • Support for extracting images (JPG, JBIG2 and Bitmaps).
  • Basic encryption (RC4) support.
  • Outline (TOC) extraction.
  • Tagged contents extraction.
  • Automatic layout analysis.

How to Install

  • Install Python 2.7 or newer.

  • Install

    pip install pdfminer.six

  • Run the following test:

    pdf2txt.py samples/simple1.pdf

Command Line Tools

PDFMiner comes with two handy tools: pdf2txt.py and dumppdf.py.

pdf2txt.py

pdf2txt.py extracts text contents from a PDF file. It extracts all the text that are to be rendered programmatically, i.e. text represented as ASCII or Unicode strings. It cannot recognize text drawn as images that would require optical character recognition. It also extracts the corresponding locations, font names, font sizes, writing direction (horizontal or vertical) for each text portion. You need to provide a password for protected PDF documents when its access is restricted. You cannot extract any text from a PDF document which does not have extraction permission.

(For details, refer to /docs/index.html.)

dumppdf.py

dumppdf.py dumps the internal contents of a PDF file in pseudo-XML format. This program is primarily for debugging purposes, but it's also possible to extract some meaningful contents (e.g. images).

(For details, refer to /docs/index.html.)

TODO

  • PEP-8 and PEP-257 conformance.
  • Better documentation.
  • Performance improvements.

Contributing

Be sure to read the contribution guidelines.