added pdf-shrinker

This commit is contained in:
Nicole Dresselhaus 2024-03-16 18:31:56 +01:00
parent 6145cb81b7
commit 56d963b0e3
1 changed files with 20 additions and 0 deletions

20
scripts/shrinkpdf.bash Executable file
View File

@ -0,0 +1,20 @@
#!/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