Created
October 8, 2021 07:39
-
-
Save kidsil/75f3b24a13ff4fea9dbaf401f908c841 to your computer and use it in GitHub Desktop.
pdf compress alias zsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Alias to compress pdf | |
function pdfcomp { | |
INPUT_FILE=$1 | |
FILE_EXTENSION="${INPUT_FILE##*.}" | |
FILE_NAME="${INPUT_FILE%.*}" | |
OUTPUT_FILE="$FILE_NAME-compressed.$FILE_EXTENSION" | |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=$OUTPUT_FILE $INPUT_FILE | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment