summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2024-02-20 08:46:31 +0100
committerJonas Smedegaard <dr@jones.dk>2024-02-20 08:46:31 +0100
commitfdacf70c2a2f4341be02ef65ea346e262b19237a (patch)
treeeb22fda98cf47b0c0d7eb90efcfc47b91969a180 /bin
parent3028efafe887d9ffcf9a75ff1aea11025dcb8e0f (diff)
compress PDF files
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pdfcompress.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/pdfcompress.sh b/bin/pdfcompress.sh
new file mode 100755
index 0000000..3fecd8f
--- /dev/null
+++ b/bin/pdfcompress.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -au
+
+INFILE=$1
+
+[ -n "$QUARTO_PROJECT_RENDER_ALL" ] || exit
+
+ps2pdf -dPDFSETTINGS=/printer "$INFILE" "$INFILE"~
+mv --force "$INFILE"~ "$INFILE"