How to Reduce PDF File Size
Ghostscript is a versatile software suite primarily serving as a PostScript and PDF file interpreter. It offers native rendering for various formats, including PDF, PostScript, PCL, XPS, raster, and vector files. Functioning as an interpreter for PostScript and PDF files, Ghostscript plays a pivotal role in converting PostScript to PDF and vice versa. Developers and designers benefit from Ghostscript's capabilities, bridging the gap between complex document formats and accessible visual output. It is often used as the #1 PDL (Page Description Language) conversion and interpreter tool.
Install Ghostscript
brew install ghostscript
Use Ghostscript to Reduce PDF File Size
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Automating Ghostscript With Hazel
Hazel automation is Folder-based automation that makes life easier on macOS. Rules-based actions on new items in folders, including renaming, reorganizing, moving, importing, uploading, and pushing notifications.
Users create rules to guide Hazel's actions, making it a powerful tool for managing clutter and saving time on repetitive tasks. With features like rule-making and automated tasks, Hazel enhances file organization, transforming chaotic desktops into streamlined, efficient spaces for Mac users. It excels in managing specific folders and offers a user-friendly interface for creating and managing automation rules.
#/bin/bash
NEWNAME=$(basename -s .pdf $1)
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile="Output/$NEWNAME-compress.pdf" "$1.pdf"