Skip to main content

A wrapper around the pdftoppm command line tool to convert pdf to a PIL Image list.

Project description

# pdf2image A python3 module that wraps the pdftoppm utility to convert PDF to the PIL image formatt

## How to install

` pip install pdf2image `

Windows users will have to install (pdftoppm)[]

Linux users will have pdftoppm pre-installed with the distro (Tested on Ubuntu and Archlinux)

## How does it work? ` from pdf2image import convert_from_path, convert_from_bytes `

Then simply do:

` images = convert_from_path(‘/home/kankroc/example.pdf’) `


` images = convert_from_bytes(open(‘/home/kankroc/example.pdf’, ‘rb’).read()) `

images will be a list of PIL Image representing each page of the PDF document.

## Limitations / known issues

  • A relatively big PDF will use up all your memory and cause the process to be killed
  • pdftoppm errors are not handled
  • Not Python 2 compatible

Project details

Download files

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

Files for pdf2image, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size pdf2image-0.1.0.tar.gz (2.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page