snippets/scripts/shrinkpdf.bash

21 lines
425 B
Bash
Raw Permalink Normal View History

2024-03-16 17:31:56 +00:00
#!/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