From 92bcf622a947de72a0fad09fd78fd2dd9412ef95 Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Thu, 18 Aug 2022 12:08:47 +0200 Subject: [PATCH] add script for reducing PDF size --- pdf/reduce_pdf_size.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 pdf/reduce_pdf_size.sh diff --git a/pdf/reduce_pdf_size.sh b/pdf/reduce_pdf_size.sh new file mode 100755 index 0000000..5556ea7 --- /dev/null +++ b/pdf/reduce_pdf_size.sh @@ -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"