Skip to content

ntshvicky/django-pdf-editor

Repository files navigation

AI-Powered Django PDF Editor

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.

PDFGenius editor interface

Features

  • 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.

Prerequisites

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd django-pdf-editor-master
  2. Create a virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows, use: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Environment Variables: Create a .env file in the project root directory and add your Gemini API key:

    GEMINI_API_KEY=your_gemini_api_key_here
  5. 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/fonts based on the FONT_FILES configuration in editor/views.py if you wish to use custom fonts.)

  6. Run the development server:

    python manage.py runserver
  7. Access the application: Open your browser and navigate to http://127.0.0.1:8000/.

Deployment

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.

Technologies Used

  • Backend: Django, PyMuPDF, ReportLab, Google GenAI SDK
  • Frontend: HTML5 Canvas, Vanilla CSS (Glassmorphism design), JavaScript, Markdown-IT, DOMPurify

About

a django python project to edit PDF data, You can add the signature, logo, shape in existing PDF.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors