You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[[ -z "$1" ]] && echo "Please enter a filename. Exiting..."
[[ -z "$1" ]] && exit 1
echo
echo -e "\e[1mThis will compress the following PDFs:\e[0m"
echo
for p in "$@"; do echo "$p"; c=$((c+1)); done
echo
echo -e "\e[1mCount: $c\e[0m"
echo
echo -e "\e[1m\e[32mPress [Enter] to continue... \e[31m[Ctrl+C to cancel]\e[0m"
read
printf "Compressing... "
for a in "$@"; do mv "$a" "$a".uncompressed; done
for b in *.pdf.uncompressed; do cc=$((cc+1)); printf "\rCompressing... $cc of $c"; qpdf --linearize "$b" - | pdftk - output "${b%.uncompressed}" compress; done