-
-
Save chandu/776bea1674f528c81189eada92f41c70 to your computer and use it in GitHub Desktop.
Shrink all pdf files in a folder (Windows)
This file contains hidden or 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