FastAPI server for online PDF processing
Michael e88cc68c7e docs: Update README hace 11 meses
app add: FastAPI hace 1 año
.env.example add: FastAPI hace 1 año
.gitignore add: FastAPI hace 1 año
README.md docs: Update README hace 11 meses
requirements.txt add: FastAPI hace 1 año

README.md

PDF Processing Server

FastAPI server for online PDF processing.

Table of Contents

Introduction

PDF Processing Server is a FastAPI-based server designed for online PDF processing. It provides endpoints for extracting text from PDF files and replacing content within PDF files. This project is developed and maintained by Gleematic Pte. Ltd.

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd PDF-Processing-Server
    
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
    
  3. Install the dependencies:

    pip install -r requirements.txt
    

Configuration

  1. Copy the .env.example file to .env:

    cp .env.example .env
    
  2. Edit the .env file to set your configuration values:

    BASE_DIR=/path/to/base/dir
    API_KEY=your_api_key
    

Running the Server

  1. Start the FastAPI server:

    uvicorn app.main:app --reload
    
  2. The server will be running at http://127.0.0.1:8000.

API Endpoints

Extraction Endpoint

  • URL: /extraction
  • Method: POST
  • Request Body: json { "pdf_zip": "base64_encoded_zip_file" }
  • Response: json { "status": "success", "data": "base64_encoded_extracted_texts" }

Replacement Endpoint

  • URL: /replacement
  • Method: POST
  • Request Body: json { "pdf_zip": "base64_encoded_zip_file", "replacement_data": "base64_encoded_json_string", "preserve_original_fonts": true }
  • Response: json { "status": "success", "data": "base64_encoded_output_zip" }

License

This project is licensed under the AGPL License due to its dependency on PyMuPDF, which is licensed under AGPL. For more details, see the AGPL-3.0 License.


Developed and maintained by Gleematic Pte. Ltd.