Skip to main content

Python interface to Apache PDFBox command-line tools.

Project description

Package Description

This prject is a fork of python-pdfbox. After the update of pdfbox, the current version for apache-pdfbox 3.x has breaking changes.

To make sure the the python-wrapper is still useable, this fork is in place. To use just replace the pip install python-pdfbox with pip install python-pdfbox-v2

Provides a simple Python 3 interface to the Apache PDFBox command-line tools.

Requirements

Aside from Python 3 and those packages specified in setup.py, python-pdfbox requires java to be present in the system path.

Some users have reported issues on MacOS with certain versions of Java. If you encounter such issues, try a recent release of OpenJDK (14 or later).

Installation

The package may be installed as follows:

pip install python-pdfbox

One may specify the location of the PDFBox jar file via the PDFBOX environmental variable. If not set, python-pdfbox looks for the jar file in the platform-specific user cache directory and automatically downloads the latest available version below 3.0.0 and caches it if not present.

Usage

The interface currently exposes only several features in PDFBox (text extraction, conversion to images, extraction of images):

import pdfbox
p = pdfbox.PDFBox()
p.extract_text('/path/to/my_file.pdf')   # writes text to /path/to/my_file.txt
p.pdf_to_images('/path/to/my_file.pdf')  # writes images to /path/to/my_file1.jpg, /path/to/my_file2.jpg, etc.
p.extract_images('/path/to/my_file.pdf') # writes images to /path/to/my_file-1.png, /path/to/my_file-2.png, etc.

Notes

Owing to a change in command line interface, python-pdfbox cannot currently use PDFBox 3.0.0.

Development

The latest release of the package may be obtained from GitHub.

Author

See the included AUTHORS.rst file for more information.

License

This software is licensed under the Apache 2.0 License. See the included LICENSE.rst file for more information.

Project details


Download files

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

Source Distribution

python-pdfbox-v2-2.0.28.4.tar.gz (9.0 MB view details)

Uploaded Source

Built Distribution

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

python_pdfbox_v2-2.0.28.4-py3-none-any.whl (9.0 MB view details)

Uploaded Python 3

File details

Details for the file python-pdfbox-v2-2.0.28.4.tar.gz.

File metadata

  • Download URL: python-pdfbox-v2-2.0.28.4.tar.gz
  • Upload date:
  • Size: 9.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for python-pdfbox-v2-2.0.28.4.tar.gz
Algorithm Hash digest
SHA256 1e6eacf59b84f6e81ef427dbfea45ba82f9569add1cb44718ac262cddab3a723
MD5 2ac26f79f20dbb1f9c581f0e41ec309f
BLAKE2b-256 0fea988733129a5110a9acf402663dcf407121de5f27c27c6f73b476ed876a58

See more details on using hashes here.

File details

Details for the file python_pdfbox_v2-2.0.28.4-py3-none-any.whl.

File metadata

File hashes

Hashes for python_pdfbox_v2-2.0.28.4-py3-none-any.whl
Algorithm Hash digest
SHA256 80f1369481db74cc87b50c6380ee396bb3acd74b19e2bb3dc6601bd7eb1a7414
MD5 d1b5c0c9e51be60c560cdacf0f27b347
BLAKE2b-256 76dd77884152c2010fb01678cefe0ffefbd2b6c7721c674838dd8755a4aa22b3

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