A simple web application built with FastAPI that lets you upload a PDF, extracts its text, and allows you to download the resulting text file. The UI is styled with Tailwind CSS for a modern look.
- Upload a PDF file via a web form
- Extracts all text from the PDF
- Download the extracted text as a
.txtfile - Clean, responsive UI with Tailwind CSS
- Python 3.8+
- See
requirements.txtfor Python dependencies
- Clone this repository:
git clone https://github.com/thakurcoderz/pdf-to-text.git cd pdf-to-text - Create and activate a virtual environment (optional but recommended):
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Start the FastAPI server:
uvicorn app:app --reload
- Open your browser and go to http://localhost:8000
- Upload a PDF, extract its text, and download the result!
├── app.py # Main FastAPI app
├── requirements.txt # Python dependencies
├── templates/ # HTML templates (Tailwind CSS)
│ ├── upload.html
│ └── result.html
├── uploads/ # Uploaded PDF files (auto-created)
├── texts/ # Extracted text files (auto-created)
├── .gitignore # Git ignore file
└── README.md # This file
- Uploaded PDFs and extracted text files are stored in
uploads/andtexts/respectively. - For production, consider cleaning up these folders regularly.
MIT