snippets/scripts/shrinkpdf.bash
2024-03-16 18:31:56 +01:00

21 lines
425 B
Bash
Executable File

#!/bin/bash
for i in $@;
do
if [ -f "${i}" ]; then
gs \
-sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/default \
-dNOPAUSE -dQUIET -dBATCH \
-dColorConverstionStrategy=/sRGB \
-dDownsampleColorImages=true \
-dDownsampleGrayImages=true \
-dDownsampleMonoImages=true \
-dOptimize=true \
-sOutputFile="${i}" \
"${i}_small.pdf"
else
echo "${i} is not a valid file."
fi
done