Created
February 19, 2024 16:54
-
-
Save passos/30c5c2decd0408e61c43160780d0a60c to your computer and use it in GitHub Desktop.
compress by ghostscript
This file contains hidden or 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
inputFile=$1 | |
outputFile=$(echo $inputFile | sed 's|\.pdf$|\.c\.pdf|ig') | |
echo " input is $inputFile, \noutput is $outputFile" | |
while true; do | |
# Prompt the user | |
read -p "Do you want to continue? (Y/N): " answer | |
# Convert the input to lowercase | |
answer=$(echo "$answer" | tr '[:upper:]' '[:lower:]') | |
# Check the input | |
if [[ $answer == "y" ]]; then | |
break | |
elif [[ $answer == "n" ]]; then | |
exit | |
fi | |
done | |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH -sOutputFile="$outputFile" "$inputFile" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment