pdfminer.six/README.md

88 lines
2.7 KiB
Markdown
Raw Permalink Normal View History

2014-09-15 09:10:00 +00:00
PDFMiner.six
============
2013-10-22 15:17:12 +00:00
2014-09-15 09:10:00 +00:00
PDFMiner.six is a fork of PDFMiner using six for Python 2+3 compatibility
[![Build Status](https://travis-ci.org/pdfminer/pdfminer.six.svg?branch=master)](https://travis-ci.org/pdfminer/pdfminer.six) [![PyPI version](https://img.shields.io/pypi/v/pdfminer.six.svg)](https://pypi.python.org/pypi/pdfminer.six/)
2014-06-14 02:24:45 +00:00
2013-10-22 15:17:12 +00:00
PDFMiner is a tool for extracting information from PDF documents.
Unlike other PDF-related tools, it focuses entirely on getting
2013-10-22 15:17:12 +00:00
and analyzing text data. PDFMiner allows one to obtain
the exact location of text in a page, as well as
2013-10-22 15:17:12 +00:00
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.
* Webpage: https://github.com/pdfminer/
2014-09-15 09:10:00 +00:00
* Download (PyPI): https://pypi.python.org/pypi/pdfminer.six/
2014-03-27 15:19:52 +00:00
2013-11-17 06:32:57 +00:00
2013-10-26 15:05:26 +00:00
Features
--------
2013-10-22 15:17:12 +00:00
* 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.
* Basic encryption (RC4) support.
* Outline (TOC) extraction.
* Tagged contents extraction.
* Automatic layout analysis.
2013-11-17 06:32:57 +00:00
2013-10-26 15:05:26 +00:00
How to Install
--------------
2013-10-22 15:17:12 +00:00
* Install Python 2.7 or newer.
2017-04-18 17:13:20 +00:00
* Install
2013-10-22 15:17:12 +00:00
2018-06-17 17:07:32 +00:00
`pip install pdfminer.six`
2013-10-22 15:17:12 +00:00
2017-04-18 17:13:20 +00:00
* Run the following test:
2013-10-22 15:17:12 +00:00
2018-06-17 17:07:32 +00:00
`pdf2txt.py samples/simple1.pdf`
2013-10-22 15:17:12 +00:00
2013-11-17 06:32:57 +00:00
2013-10-26 15:05:26 +00:00
Command Line Tools
------------------
PDFMiner comes with two handy tools:
pdf2txt.py and dumppdf.py.
2013-11-05 09:25:37 +00:00
**pdf2txt.py**
2013-10-26 15:05:26 +00:00
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.)
2013-10-26 15:05:26 +00:00
2013-11-05 09:25:37 +00:00
**dumppdf.py**
2013-10-26 15:05:26 +00:00
dumppdf.py dumps the internal contents of a PDF file in pseudo-XML format.
2013-10-26 15:05:26 +00:00
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.)
2013-10-26 15:05:26 +00:00
2013-11-17 06:32:57 +00:00
2013-10-26 15:05:26 +00:00
TODO
----
* PEP-8 and PEP-257 conformance.
* Better documentation.
2018-06-17 17:07:32 +00:00
* Performance improvements.
2013-10-26 15:05:26 +00:00
2013-11-17 06:32:57 +00:00
Contributing
------------
Be sure to read the [contribution guidelines](https://github.com/pdfminer/pdfminer.six/blob/master/CONTRIBUTING.md).