Skip to main content

A set of extended tools to process pdf files

Project description

PdfExTools

This package contains tools can be used to handle pdf files.

1. PageNumberExtractor:

to extract physical page numbers, i.e., the page numbers printed in page (as part of content in the page), rather than the logical page numbers tracked by pdf reader or tools like pdfplumber, pymupdf, etc. This can be useful because sometimes the pdf file was excerpted from a large file, as a result, the page number showing in page can start from 135 to 145, while the total number of pages is 11 (1-11).

1) to install:

pip install PdfExTools

2) to use, do the following:

from pdfextools import PageNumberExtractor

pdf_file = r"./sample-pdfs/2-col-pubmed.pdf"

print("pdf_file: " + pdf_file)

extractor = PageNumberExtractor()
page_numbers = extractor.process(pdf_file)

print(page_numbers)

The result will be a dictionary mapping logical page numbers (base-0) to the physical ones. For example:

pdf_file: /sample-pdfs/2-col-pubmed.pdf
{0: 11, 1: 12, 2: 13, 3: 14, 4: 15, 5: 16, 6: 17, 7: 18, 8: 19, 9: 20, 10: 21, 11: 22, 12: 23}

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

pdfextools-0.3.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

pdfextools-0.3.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file pdfextools-0.3.0.tar.gz.

File metadata

  • Download URL: pdfextools-0.3.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for pdfextools-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7d158398758ed0a9ffdc2894bc89bebe26f9761dd340635817ebb9cee54fa9c4
MD5 473d02fb2405e92627be6f5888b23f86
BLAKE2b-256 0c64b6eebaf254642934e3710df0ddd8975d13ef62d82c688995811bfc5a92ca

See more details on using hashes here.

File details

Details for the file pdfextools-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pdfextools-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for pdfextools-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f649d4763c06a372117b9ae7cf1b61ef0b2509eee4a8a260f858b5b5af151cd1
MD5 61293afcc13178f51e59d735f9cbc737
BLAKE2b-256 fa909c716c61dcccbe009f56e806a4117e45a060b88046ae2646e3c0e83c7d99

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