Skip to main content

pdflayoutxt

pdflayoutxt is a Python library for extracting text from searchable pdf's (Non Scanned) and it make sures the extracted text is in the same layout as the document.

Installation

Use the package manager pip to install foobar.

pip install pdflayoutxt

Usage

# import the library
import pdflayoutxt

# creates an object of pdfextracter
pdfobj=pdflayoutxt.pdfextracter()

# returns a list, each index being the text extracted from that index page. 
# In simple terms no_of_pages_in_document==len(list_returned)
pdf_path="./abc.pdf"
text=pdfobj.get_pdf_text(pdf_path=pdf_path)

# output
print(text)
Method Description
.get_pdf_text(pdf_path,pdf_password="",pages=[],left_most_x=0,left_most_y=0,right_most_x=1,right_most_y=1) Returns a list of list, of texts, present in each of the page in the document.pdf_password argument takes a string input,if pdf is encrypted with password, the password needs to be passed to this argument. Pages argument takes a list of pages or int (single page) from where the text needs to be extracted, if text from all pages are required the default parameter will take care. left_most_x this parameter defines the starting point of text extraction on x axis (width). Its value lies between [0,1], like if we need .25 percent of right side of page (width) then we will pass .75 as argument. left_most_y this parameter defines the starting point of text extraction on y axis (height). Its value lies between [0,1], like if we need .25 percent of text from bottom side of page (height) then we will pass .75 as argument. right_most_x this parameter defines the end point of text extraction on x axis (width). Its value lies between [0,1]. right_most_y this parameter defines the end point of text extraction on y axis (height). Its value lies between [0,1]. These parameters right_most_y,left_most_x,right_most_x,left_most_y are set to default for extracting text from complete page without cropping, if the text needs to be extracted from a particular area of page, these parameters become handy.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Metadata

Release files for pdflayoutxt 0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pdflayoutxt 0.0.10
File Size Uploaded Provenance Actions
pdflayoutxt-0.0.10.tar.gz 4.4 kB Without provenance Details for pdflayoutxt-0.0.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pdflayoutxt 0.0.10
File Interpreter ABI Platform Actions
pdflayoutxt-0.0.10-py3-none-any.whl Python 3 none any Details for pdflayoutxt-0.0.10-py3-none-any.whl

Total release size: 9.3 kB

Release files / pdflayoutxt-0.0.10.tar.gz

Download URL pdflayoutxt-0.0.10.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2fbf2be836e70dcfa5e78250165e3fed81de71b41f9697969f06a4851a17d470
BLAKE2b-256 checksum
How to use checksums
8bc4b4fd4022b8c768bd978fb9a26864d51ae5c2fd7de3083e027440c5115edc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.5

Release files / pdflayoutxt-0.0.10-py3-none-any.whl

Download URL pdflayoutxt-0.0.10-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e8d15c38ff2a0780fbee3a6df04d97892df33cfb147dab41fd386d16b407c5b
BLAKE2b-256 checksum
How to use checksums
d513501afec18f526623255571cc182d9d1c20614a5aa2d94377ed55957c06e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.5

Security for pdflayoutxt 0.0.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page