chekuhakim / paperweight

Paperweight: Open-Source PDF Compression Self Hosted
GNU General Public License v3.0
43 stars 2 forks source link

logo

Paperweight: Open-Source PDF Compression

Welcome to Paperweight, a self-hosted open-source PDF compression tool built with Python and Bottle!

This repository contains the source code for Paperweight, allowing you to easily compress PDF files on your own server without relying on external services. Paperweight utilizes Ghostscript for efficient and customizable compression.

Features:

Installation:

Option 1: Docker

  1. Pull the Docker image: docker pull chekuhakim/paperweight
  2. Run the container: docker run -p 8000:8000 chekuhakim/paperweight
  3. Access the web interface: Open your web browser and navigate to http://localhost:8000/ (or the corresponding IP address and port if running on a server).

Option 2: Manual Installation

  1. Clone the repository: git clone https://github.com/chekuhakim/paperweight.git
  2. Install dependencies:
    • Ensure you have Python 3.7+ installed.
    • Install required packages: pip install bottle ghostscript
  3. Run the application: python app.py
  4. Access the web interface: Open your web browser and navigate to http://localhost:1234/ (or the corresponding IP address and port if running on a server).

Usage:

  1. Upload a PDF file: Use the file upload button on the web interface to select the PDF you want to compress.
  2. Choose compression level: Select the desired compression level using the slider or input field. Higher values result in smaller file sizes but may reduce quality.
  3. Compress: Click the "Compress" button to start the compression process.
  4. Download: Once compression is complete, the compressed PDF file will be automatically downloaded.

Notes: