Created
January 2, 2015 08:46
-
-
Save xoofx/61cb6850dc9c4bdcb81c to your computer and use it in GitHub Desktop.
Shrink all pdf files in a folder (Windows)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM Install Ghostscript 64bit from http://www.ghostscript.com/download/gsdnld.html | |
REM Shrink all pdfs files in the current directory where this script is run and output to the | |
REM compressed sub-folder | |
setlocal | |
set GS_BIN=C:\Program Files\gs\gs9.15\bin\gswin64c.exe | |
set GS_OUTPUT_DIR=compressed | |
mkdir %GS_OUTPUT_DIR% | |
for %%i in (*.pdf) do "%GS_BIN%" -dNOPAUSE -dBATCH -dSAFER -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 -sDEVICE=pdfwrite -sOutputFile="%GS_OUTPUT_DIR%\%%i" "%%i" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please update line 6 to the current version of Ghostscript gs9.52 (as at April 2, 2020).