A modern web application for PDF manipulation built with Python Flask backend and Next.js frontend.
- Split PDF: Split PDF files into individual pages or extract specific page ranges
- Merge PDF: Combine multiple PDF files into a single document
- PDF to Word: Convert PDF documents to editable Word files (.docx)
- Word to PDF: Convert Word documents to PDF format
- Python 3.11
- Flask
- PyPDF2 (PDF manipulation)
- pdf2docx (PDF to Word conversion)
- LibreOffice (Word to PDF conversion)
- Next.js 14
- React 18
- TypeScript
- Tailwind CSS
- Axios
- Docker and Docker Compose
- (Optional) Node.js 18+ and Python 3.11+ for local development
- Clone the repository:
git clone <repository-url>
cd pdf- Build and run the containers:
docker-compose up --build- Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- Navigate to the backend directory:
cd backend- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt-
Install LibreOffice (required for Word to PDF conversion):
- Ubuntu/Debian:
sudo apt-get install libreoffice - macOS:
brew install --cask libreoffice - Windows: Download from https://www.libreoffice.org/
- Ubuntu/Debian:
-
Run the Flask server:
python app.pyThe backend will run on http://localhost:5000
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Create a
.env.localfile:
NEXT_PUBLIC_API_URL=http://localhost:5000- Run the development server:
npm run devThe frontend will run on http://localhost:3000
GET /health
POST /split-pdf
Content-Type: multipart/form-data
Parameters:
- file: PDF file
- mode: 'all' or 'range'
- start_page: (optional, for range mode) starting page number
- end_page: (optional, for range mode) ending page number
POST /merge-pdf
Content-Type: multipart/form-data
Parameters:
- files: Multiple PDF files (minimum 2)
POST /pdf-to-word
Content-Type: multipart/form-data
Parameters:
- file: PDF file
POST /word-to-pdf
Content-Type: multipart/form-data
Parameters:
- file: Word document (.docx or .doc)
docker-compose up --builddocker-compose up -ddocker-compose downdocker-compose logs -fdocker-compose up --build backend
docker-compose up --build frontendThe application is fully responsive and works on:
- Desktop computers
- Tablets
- Mobile phones
- Drag and drop file upload
- Clear visual feedback
- Progress indicators
- Error handling
- Clean and modern UI
- Files are automatically deleted after processing
- No data is stored permanently
- All processing happens server-side
- Maximum file size: 50MB per file
- Maximum files for merge: 10 PDFs
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
MIT
Contributions are welcome! Please feel free to submit a Pull Request.