A self hostable Flask web application that splits a PDF file into individual pages and provides download links for each split page.
- Upload a PDF file and split it into individual pages.
- Download each page as a separate PDF.
- Python 3.10 or higher
- Flask
- PyPDF2
- Clone the Repository
git clone https://github.com/tshenolo/flask-pdf-splitter.git cd flask-pdf-splitter- Installation Install dependencies You can install the required dependencies by running:
pip install -r requirements.txt -
Open Command Prompt or PowerShell and navigate to the project directory.
-
Set the FLASK_APP environment variable:
set FLASK_APP=app.py - Start the Flask server:
python app.py - Open a browser and go to http://127.0.0.1:5000
-
Open a terminal and navigate to the project directory.
-
Set the FLASK_APP environment variable:
export FLASK_APP=app.py - Start the Flask server:
python app.py - Open a browser and go to http://127.0.0.1:5000
- Build the Docker Image:
docker build -t flask-pdf-splitter . - Run the Docker Container:
docker run -p 5000:5000 -v $(pwd)/static/pages:/app/static/pages flask-pdf-splitter - Access the Application: Open your browser and navigate to http://localhost:5000.
- Upload a PDF file using the file upload form.
- Click the "Split PDF" button.
- The split pages will be displayed as download links for each page.
flask-pdf-splitter/ ├── app.py # Main application file ├── Dockerfile # Docker configuration ├── requirements.txt # Python dependencies ├── templates/ │ └── index.html # HTML template for the application └── static/ └── pages/ # Directory where split pages are saved - Fork the repository.
- Create a new branch (git checkout -b feature-branch).
- Commit your changes (git commit -am 'Add new feature').
- Push to the branch (git push origin feature-branch).
- Create a new Pull Request.
This project is licensed under the MIT License.
