commit 3fc54ffebb542fc8d83e562077c9bebc23b04002 parent aa857c84b03cdcae2079108bda4f467269411674 Author: Anders Damsgaard <andersd@riseup.net> Date: Mon, 4 Dec 2017 11:29:06 -0500 Add script to compress PDFs Diffstat:
A | links/bin/pdf-compress.sh | | | 16 | ++++++++++++++++ |
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/links/bin/pdf-compress.sh b/links/bin/pdf-compress.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +if [[ $# -gt 0 ]]; then + + for f in "$@"; do + echo "processing '$f'" + /usr/local/bin/gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \ + -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH \ + -dDetectDuplicateImages \ + -dCompressFonts=true -r150 \ + -sOutputFile="${f%.*}_compressed.pdf" "$f"; + done +else + echo "Error: you must specify one or more input PDF files" + exit 1 +fi