Skip to main content

Tools of extracting PDF content based on RapidOCR

Project description

RapidOCRPDF

PyPI SemVer2.0 GitHub

  • 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. Usage

  • 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.

  • InputUnion[str, Path, bytes]
  • OutputList [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


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

rapidocr_pdf-0.0.7-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file rapidocr_pdf-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for rapidocr_pdf-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4f9a00691c0eef1bc042dc5f7c49b17b767bf9eef6938fda22b21c1966d1e378
MD5 485af716af22f5c55c87a1b9a5920aa4
BLAKE2b-256 1a6096d082d215e8568dd53c73a5bbb400408c9bafb61f81090219c87907bdc2

See more details on using hashes here.

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