OptimizePDF Script - README


The OptimizePDF script (Bash) uses the Ghostscript Interpreter (for PostScript language and PDF) to optimize PDF files in a specified folder and sends you an email notification if the process has finished. The script will also display information about the optimization progress and the size difference of each PDF file due to the compression and/or optimization. The script can be customized in the configuration section.


OptimizePDF - Optimization 1 OptimizePDF - Optimization 2


  • Install the software packages sendemail, libnet-ssleay-perl and libio-socket-ssl-perl.
  • You can use the command: apt-get install sendemail libnet-ssleay-perl libio-socket-ssl-perl
  • Copy the script folder optimizepdf to your computer.
  • Make the optimizer script executable: chmod +x
  • Edit the configuration section of the script to fit your needs.
  • Open the firewall port 587 if you want to send notification emails!
  • Copy some PDF files into the input subfolder.
  • Start the optimizer script from the command prompt: ./
  • Optional you can specify a color resolution (in dpi) as a parameter: ./ 120
  • Get the optimized PDF files from the output subfolder and check if a notification was sent by email.


This is a free tool and support is not included and guaranteed. Nevertheless I will try to answer all your questions if possible. So write to my email address biegel[at] if you have a question :-)


The OptimizePDF script is licensed under the MIT License (Expat) which is published on the official site of the Open Source Initiative. The Ghostscript Interpreter is licensed under the GNU Affero General Public License (GNU AGPL). More information from Artifex about their licensing is available on the Artifex Website.