Skip to main content

A wrapper around the poppler's and pdftoimage, pdftphtml and pdftotext command line tools to extract informaton from pdf

Project description

poppdf

A python (3.6+) module that wraps poppler's pdftoimage, pdftohtml and pdftotext to extract informations from PDF.

What information is extracted

  • image
  • text
  • infromation about the position of various text lines

How to install

pip install poppdf

Windows

Windows users will have to build or download poppler for Windows. I recommend @oschwartz10612 version which is the most up-to-date. You will then have to add the bin/ folder to PATH or use poppler_path = r"C:\path\to\poppler-xx\bin" as an argument in convert_from_path.

Mac

Mac users will have to install poppler for Mac.

Linux

Most distros ship with pdftoppm and pdftocairo. If they are not installed, refer to your package manager to install poppler-utils

Platform-independant (Using conda)

  1. Install poppler: conda install -c conda-forge poppler
  2. Install pdf2image: pip install pdf2image

How does it work?

from pdf2image import image_from_path, xml_from_path, text_from_path

from poppdf.pdfDocument import PdfDocument

Then simply do:

pdf = PdfDocument('example.pdf')

And

print(pdf.pdf_pages[1].text)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

poppdf-0.15.7-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file poppdf-0.15.7-py3-none-any.whl.

File metadata

  • Download URL: poppdf-0.15.7-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.2

File hashes

Hashes for poppdf-0.15.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3b07716a390b3b726b3d2d55cb2f10bd4a55317fad7c0aaa83eccad73c1db393
MD5 9ad3e0dc701238dae89ad1fd887def67
BLAKE2b-256 6b2562f5b844e827c65c8078d315acf3dc3564f402784676e2cb6741fc311365

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page