A powerful web-based PDF editing toolkit built with Flask, PyPDF2, and a clean frontend.
Merge, split, rotate, annotate, fill forms, encrypt, and more from your browser.
- Upload one or multiple PDF files
- Preview PDFs in the browser and visually select pages
- Merge multiple PDFs into one document
- Split PDFs by custom page ranges (for example:
1-3,5,7-9) - Extract selected pages into a new file
- Rotate specific pages (
90°,180°,270°,-90°) - Add text overlays with custom position and font size
- Add image overlays (for logos, stamps, signatures, etc.)
- Read and update metadata (author, title, subject, keywords)
- Extract text from selected pages
- Read and fill PDF form fields
- Encrypt PDFs with password protection
| Backend | Frontend | PDF Libraries |
|---|---|---|
| Python + Flask | Vanilla JS | PyPDF2 |
| HTML5 / CSS3 | pdfplumber | |
| reportlab | ||
| Pillow (PIL) |
pdf_editor_app/
├── app.py # Flask routes and API endpoints
├── pdf_editor.py # Core PDF editing operations
├── requirements.txt # Python dependencies
├── templates/
│ └── index.html # Main user interface
├── static/
│ ├── script.js # Frontend logic
│ └── style.css # Custom styles
├── uploads/ # Uploaded PDFs and images
│ └── images/ # Uploaded image overlays
├── outputs/ # Generated PDF files
└── README.md # Project documentation
- Python 3.10 or newer
pip
- Clone the repository (or download the source):
git clone https://github.com/BnHany/pdf-forge-studio.git cd pdf-forge-studio/pdf_editor_app - Create a virtual environment:
python -m venv .venv
- Activate the environment:
Windows (PowerShell):
macOS/Linux:
.\.venv\Scripts\Activate.ps1
source .venv/bin/activate - Install dependencies:
pip install -r requirements.txt
- Run the application:
python app.py
- Open in your browser:
http://127.0.0.1:5000
- Upload PDFs from the upload section.
- Select an operation tab: Merge, Split, Extract, Rotate, Add Text, Add Image, Fill Form, Encrypt, Metadata, or Read Text.
- Configure options (page ranges, text position, image, password, metadata, etc.).
- Run the action and download the output from the Results section.
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Main web interface |
| POST | /upload |
Upload PDF file(s) |
| POST | /upload_image |
Upload an image for overlay |
| GET | /download/<file_id> |
Download a generated or uploaded PDF |
| GET | /view/<file_id> |
View a PDF inline in the browser |
| GET | /pdf_info?file=<id> |
Get page count and URLs for a PDF |
| POST | /merge |
Merge multiple PDFs |
| POST | /split |
Split PDF by page ranges |
| POST | /extract |
Extract selected pages |
| POST | /rotate |
Rotate a specific page |
| POST | /add_text |
Add text overlay to a page |
| POST | /add_image |
Add image overlay to a page |
| POST | /extract_text |
Extract text from selected pages |
| GET | /form_fields?file=<id> |
Read form fields from a PDF |
| POST | /fill_form |
Fill form fields and export |
| POST | /encrypt |
Encrypt PDF with a password |
| GET | /metadata |
Read PDF metadata |
| POST | /metadata |
Update PDF metadata |
- Max request size:
100 MB(configured in Flask) - Upload directory:
pdf_editor_app/uploads/ - Image uploads:
pdf_editor_app/uploads/images/ - Output directory:
pdf_editor_app/outputs/ - Generated files remain on disk until manually removed
- The app currently runs with Flask debug mode enabled (
app.run(debug=True)). - Operations are file-based; uploaded/generated files are referenced by unique IDs.
- For production, use a WSGI server (for example, Gunicorn or Waitress) and disable debug mode.
BnHany
Built with ❤️ to simplify PDF editing for everyday users.
Contributions, issues, and feature requests are welcome.
This project is licensed under the MIT License.
Feel free to use, modify, and distribute. Please give proper credit and use responsibly.