mae-ghostscript
is a Docker-based tool designed for compressing PDF files using Ghostscript. This repository includes a Docker image that streamlines the PDF compression process in a consistent, containerized environment. For more details, visit the GitHub repository.
- Simple PDF compression using Ghostscript.
- Runs within a Docker container, ensuring a consistent and isolated environment.
- Easy to use with straightforward input commands.
- Docker installed on your machine.
- Access to the Docker Hub repository maemresen/mae-ghostscript.
To compress a PDF file, follow these steps:
- Place your PDF files in a local directory named
pdf-files
(or create one in your current directory). - Run the Docker command directly.
Run the container using the following command:
docker run --rm -it --name mae-ghostscript \
-v "$(pwd)/pdf-files:/app/pdf-files" \
-e "INPUT_PDF=your-input-file.pdf" \
maemresen/mae-ghostscript
The output file will be generated with the pattern <input-filename>-compressed-<timestamp>.pdf
, where <input-filename>
is the name of the input file without the .pdf
extension, and <timestamp>
is the current date and time. The compressed file will be located in the pdf-files
directory.
Example:
- Input file:
example.pdf
- Output file:
example-compressed-2024_11_09-12_30_45.pdf
INPUT_PDF
: The name of the input PDF file to be compressed.
Ensure that the INPUT_PDF
file is located in the pdf-files
directory.
To build the Docker image locally:
docker build --no-cache -t maemresen/mae-ghostscript .
This project is licensed under the MIT License.
Mehmet Arif Emre Sen