
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:
Lossless and Lossy Compression: Choose between lossless compression for maximum quality or lossy compression for smaller file sizes using different compression levels. Customizable Settings: Fine-tune compression parameters to achieve the desired balance between file size and quality through Ghostscript settings. Self-Hosted: Maintain complete control over your data and avoid dependence on third-party services. Easy to Use: Simple web interface allows you to upload PDFs and select compression levels for quick and easy compression. Dockerized: Easy deployment and setup using Docker. Installation:
Option 1: Docker
Pull the Docker image: docker pull chekuhakim/paperweight Run the container: docker run -p 8000:8000 chekuhakim/paperweight 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
Clone the repository: git clone https://github.com/chekuhakim/paperweight.git Install dependencies: Ensure you have Python 3.7+ installed. Install required packages: pip install bottle ghostscript Run the application: python paperweight.py 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:
Upload a PDF file: Use the file upload button on the web interface to select the PDF you want to compress. 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. Compress: Click the "Compress" button to start the compression process. Download: Once compression is complete, the compressed PDF file will be automatically downloaded. Notes:
The Docker image includes all necessary dependencies, including Python, Bottle, and Ghostscript. You can adjust the port mapping (-p 8000:8000) in the docker run command if needed. For manual installation, ensure Ghostscript is installed and accessible on your system. You can adjust the port number and host address in the paperweight.py file if needed. The provided code includes a basic HTML template (index.html) for the web interface. You can customize this template to fit your preferences.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务