This Windows batch processing script provides an efficient way to compress PDF files using different compression levels and options.
It utilizes the Ghostscript to perform operations on PDF files.
-
Windows operating system.*
-
Ghostscript.**
* - Tested on Windows 10 and Windows 11 operating systems, both x86 and x64 architectures. The scripts have not been tested on earlier versions. |
---|
* - If Ghostscript is not installed, the latest release will be detected and offered to install when Batch PDF Compressor is launched. |
---|
The script offers the following features:
- Automatic selection of English, Ukrainian, or Russian according to the system language using universal UTF-8 (support for external message files has been added).
- Selection the path to the directory with PDF files to be compressed using the windows.Forms.FolderBrowserDialog. With path validation and allowance for 3 false addresses or bounces.
- Selection of compression level: low, medium, high, ultra.
- Choose to delete or save original PDF files.
- The script processes all PDF files within the specified directory and its subdirectories.
- Displays progress of file processing and compression.
- Upon completion, provides an overview of script execution, including the number of processed files, sizes before and after compression, and the compression ratio.
- Additionally, the script checks the system for the presence of Ghostscript before execution and maintains a detailed log file for each compression operation.
- Use the executable installer (best practice) or clone the project and run the
batch_PDF_compressor.bat
script (If you are using a batch script, make sure that the text files with messages are available in the/messages
directory and the modules are available in the/modules
directory). - The required language will be selected automatically according to the system settings.
- Select the directory containing the PDF files you want to compress. The script will "look" at the lower levels and process the PDFs in the subdirectories on its own.
- Select the compression level (1-4) corresponding to the provided options.
- Choose whether to delete or keep the original PDF files.
- After completion you can find the a log file containing information about processed files and compression results at
%UserProfile%\Documents
with the namebatch_PDF_compressor_log.txt
.
This script is distributed under the MIT License. For more details, refer to the LICENSE.md file.