Tools of extracting PDF content based on RapidOCR
Project description
RapidOCRPDF
- Relying on RapidOCR, quickly extract text from PDF, including scanned PDF and encrypted PDF.
- Layout restore is not included for now.
1. Install package by pypi.
# base rapidocr_onnxruntime
pip install rapidocr_pdf[onnxruntime]
# base rapidocr_openvino
pip install rapidocr_pdf[openvino]
2. Use
- Run by script.
from rapidocr_pdf import PDFExtracter pdf_extracter = PDFExtracter() pdf_path = 'tests/test_files/direct_and_image.pdf' texts = pdf_extracter(pdf_path) print(texts)
- Run by command line.
$ rapidocr_pdf -h usage: rapidocr_pdf [-h] [-path FILE_PATH] options: -h, --help show this help message and exit -path FILE_PATH, --file_path FILE_PATH File path, PDF or images $ rapidocr_pdf -path tests/test_files/direct_and_image.pdf
3. Ouput format.
- Input:
Union[str, Path, bytes]
- Output:
List
[Page num, Page content + score], :[ ['0', '达大学拉斯维加斯分校)的一次中文评测中获得最', '0.8969868'], ['1', 'ABCNet: Real-time Scene Text Spotting with Adaptive Bezier-Curve Network∗\nYuliang Liu‡†', '0.8969868'], ]
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file rapidocr_pdf-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: rapidocr_pdf-0.0.3-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89a99042a0c0a996c6a85d1d9e959f82ec0dcdd2cfbb5d00242daf7bc8b11328 |
|
MD5 | dbb726723ca70582e94cff9ff860f2ca |
|
BLAKE2b-256 | f32fa17d78b44786f51bd80131b3726de23039ad3e7d01e0fa8145bf5a195548 |