Git Product home page Git Product logo

pdfminer3's Introduction

pdfminer3

gwk/pdfminer3 is a Python 3.7 fork of pdfminer/pdfminer.six. It was forked in December of 2018 to experiment with a Python 3 version of the library. Since then the original has migrated to Python 3 only and this fork is now very stale. However there might be a few small fixes here that could still be applicable to the community version.

This fork is kept for archive purposes only.

pdfminer3 is a tool for extracting information from PDF documents. Unlike other PDF-related tools, it focuses entirely on getting and analyzing text data. pdfminer3 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.
  • Basic encryption (RC4) support.
  • Outline (TOC) extraction.
  • Tagged contents extraction.
  • Automatic layout analysis.

How to Install

  • Install Python 2.7 or newer. (Python 3.x is supported in pdfminer3)

  • Install

    pip install pdfminer3

  • Run the following test:

    pdf2txt.py samples/simple1.pdf

Command Line Tools

pdfminer3 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.

Terms and Conditions

(This is so-called MIT/X License)

Copyright (c) 2004-2014 Yusuke Shinyama

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

pdfminer3's People

Contributors

begnini avatar bittner avatar cybjit avatar daniel-km avatar euske avatar goulu avatar gwk avatar hughsw avatar jcushman avatar jordanreiter avatar jwilk avatar kolanich avatar massongit avatar mawoqiw avatar mduggan avatar mpasternak avatar oculushut avatar orangain avatar pablocastellano avatar pquentin avatar pudo avatar rsennrich avatar sergei-maertens avatar sorced-jim avatar sschuberth avatar taeguni avatar tataganesh avatar timb07 avatar vstoykov avatar yosida95 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pdfminer3's Issues

While performing Layout analysis, do not collect certain LT elements

The problem I have been facing is some of the PDFs I have been scrapping for text information will occasionally have a figure in the PDF will have over 10000 individual objects. I want to collect text data and LTLine/LTCurves data, along with it's location (for table analysis), but I do not need figures for the analysis.
I have been trying to figure out if there is a way to not to collect figure data to speed up my script.

This is the script I am using to extract PDF data.
extract_pdf_layout.docx

The script will get hung up and take over 10 minutes for 1 page in the line:
interpreter.process_page(page)

I just want to know if there is a way to skip over collecting figure data, to speed up my script.

Thank you

pip3 install pdfminer3

While installing pdfminer3 its installed in under ~.loca/lib/python3.6/site-packages/pdfminer3 why?
I am using minecart in which its is using this library as import pdfminer

How to install it as pdfminer ?

Clean Text

How can i extract a clean text from my Pdf file? I don't want header and footer to come between my paragraphs and not even page no.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.