MakeItPrivate

February 21, 2025 ยท View on GitHub

MakeItPrivate is a Python-based application that converts images (JPG, PNG) to PDF and vice versa. It also allows creating a PDF from a list of images and PDFs. The application uses FastAPI for the backend and Streamlit for the frontend.

Features

  • Convert images (JPG, PNG) to PDF
  • Convert PDF to images (JPG, PNG)
  • Create a PDF from a list of images and PDFs

Requirements

  • Python 3.10
  • Docker
  • Docker Compose

Installation

  1. Clone the repository:

    git clone https://github.com/LittleYellowPanda/MakeItPrivate.git
    cd MakeItPrivate
    
  2. Build and run the Docker containers:

    docker-compose up --build
    

Usage

  1. Open your web browser and navigate to http://localhost:8501 to access the Streamlit frontend.

  2. Upload JPG or PNG images using the file uploader widget.

  3. Click the "Convert to PDF" button to convert the uploaded images to a PDF.

  4. Download the generated PDF using the provided download button.

Project Structure

  • app.py: Streamlit frontend application.
  • converter.py: FastAPI backend application for handling file uploads and conversions.
  • Dockerfile: Dockerfile for building the application container.
  • docker-compose.yml: Docker Compose file for setting up the application services.

API Endpoints

  • POST /upload/: Accepts multiple image files, saves them, and converts them into a PDF.
  • POST /merger/: Accepts multiple pdf files, saves them, and converts them into one single PDF.

Example

  1. Upload images using the Streamlit interface:

    Upload Images

To uninstall the Docker container

To uninstall the docker container, follow these commands:


# Remove existing containers and images:
docker-compose down --rmi all --volumes --remove-orphans

# Prune unused Docker objects
docker system prune -a --volumes

Author

  • Marina CHAU

License

This project is licensed under the MIT License.