Skip to main content

Parsing PDF files with PDFium

Project description

redstork

PyPI version Documentation Status

PDF Parsing library, based on PDFium.

Requirements

  • Fairly recent Linux (Ubuntu 18.04 or better). Support for other platforms is in the works.
  • Python 3

Installation

pip install redstork

Quick start

Download a sample PDF file from here: https://github.com/innodatalabs/redstork/blob/master/redstork/test/resources/sample.pdf

from redstork import Document

doc = Document('sample.pdf')

print('Number of pages:', len(doc))
>> Number of pages: 15

print('MediaBox of the first page is:', doc[0].media_box)
>> MediaBox of the first page is: (0.0, 0.0, 612.0, 792.0)

print('Rotation of the first page is:', doc[0].rotation)
>> Rotation of the first page is: 0

doc[0].render('page-0.ppm', scale=2)   # render page #1 as image

API docs

https://red-stork.readthedocs.io

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

redstork-0.0.9-py3-none-any.whl (19.1 MB view hashes)

Uploaded Python 3

Supported by

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