[BASH] Add a function to compress pdf

This commit is contained in:
Gregory Trolliet 2020-12-10 11:26:16 +01:00
parent f15f2282e3
commit 9e3a0283dc

17
.bashrc
View file

@ -175,4 +175,21 @@ function syncSubSessionCloud() {
rsync -av --delete /media/HDD1/NextcloudSS/Sub-Session/ "/media/raghnarok/SubSession$disk/cloud/"
}
function pdfcompress(){
if [ -z ${3+x} ];
then
quality=printer
else
case $3 in
ebook | screen | printer | prepress | default )
quality=$3
;;
*)
quality='default'
;;
esac
fi
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/$quality -dNOPAUSE -dQUIET -dBATCH -sOutputFile="$2" "$1"
}
export PATH="$HOME/.cargo/bin:$PATH"