A premium, responsive web application for editing PDFs and chatting with your documents using AI. Built with Django, PyMuPDF, and Google's Gemini AI, featuring a modern glassmorphism user interface.
- Modern Glassmorphism UI: A beautiful, responsive interface that works flawlessly on desktop and mobile.
- AI PDF Chat: Ask questions about your PDF and get intelligent answers powered by Google's Gemini AI.
- PDF Editing:
- Select and edit existing PDF text spans.
- Delete or replace images already embedded in the PDF.
- Add blank pages, duplicate pages, and delete pages from an existing PDF.
- Add text with customizable fonts, sizes, and colors.
- Draw shapes (rectangles, circles, lines) with various styles.
- Insert images into your PDFs.
- Interactive canvas for precise positioning and manipulation of elements.
- Robust File Management: Securely upload, edit, and export your modified PDFs.
- Python 3.8+
- Google Gemini API Key (for AI chat features)
-
Clone the repository:
git clone <repository-url> cd django-pdf-editor-master
-
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows, use: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Environment Variables: Create a
.envfile in the project root directory and add your Gemini API key:GEMINI_API_KEY=your_gemini_api_key_here
-
Set up the database and media directories:
python manage.py makemigrations python manage.py migrate mkdir -p media/pdfs mkdir -p media/fonts
(Note: You'll need to place your font files (.ttf) inside
media/fontsbased on theFONT_FILESconfiguration ineditor/views.pyif you wish to use custom fonts.) -
Run the development server:
python manage.py runserver
-
Access the application: Open your browser and navigate to
http://127.0.0.1:8000/.
This project is configured for deployment on Vercel.
Ensure you have whitenoise installed and configured in settings.py for serving static files, and set your environment variables (like GEMINI_API_KEY) in your deployment platform's settings.
- Backend: Django, PyMuPDF, ReportLab, Google GenAI SDK
- Frontend: HTML5 Canvas, Vanilla CSS (Glassmorphism design), JavaScript, Markdown-IT, DOMPurify