summaryrefslogtreecommitdiff
path: root/bin/pdfcompress.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pdfcompress.sh')
-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"