add script for reducing PDF size

master
Christian Ulrich 2022-08-18 12:08:47 +02:00
parent 5227403e1f
commit 92bcf622a9
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 12 additions and 0 deletions

12
pdf/reduce_pdf_size.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
# PDFSETTINGS:
# -dPDFSETTINGS=/screen lower quality, smaller size (72 dpi)
# -dPDFSETTINGS=/ebook better quality, larger size (150 dpi)
# -dPDFSETTINGS=/prepress same as Acrobat Distiller "Prepress Optimized" setting (300 dpi)
# -dPDFSETTINGS=/printer same as Acrobat Distiller "Print Optimized" setting (300 dpi)
# -dPDFSETTINGS=/default useful across a wide variety of uses, which may result in a larger output file
if [ "$#" -ne 2 ]; then
echo "usage: $0 INPUT_FILE OUTPUT_FILE"
exit 1
fi
gs -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="$2" "$1"