summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-11-08 22:20:29 +0100
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-11-08 22:20:29 +0100
commitcf3c99e9462cf4f56f1cceb053cc923875cc018d (patch)
tree76d952658b7c8d8a7d8aef2b66ae63574561a6a4
parentae4f6ec5d716bdca1a920515fce78121a6953c69 (diff)
downloadcodex-arcana-cf3c99e9462cf4f56f1cceb053cc923875cc018d.zip
codex-arcana-cf3c99e9462cf4f56f1cceb053cc923875cc018d.tar.bz2
Adds PDF files handling scripts.
-rwxr-xr-xpdf_extract_pages.sh9
-rwxr-xr-xpdf_reduce_size.sh7
2 files changed, 16 insertions, 0 deletions
diff --git a/pdf_extract_pages.sh b/pdf_extract_pages.sh
new file mode 100755
index 0000000..0905241
--- /dev/null
+++ b/pdf_extract_pages.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+if [[ ! $# -eq 4 ]]
+then
+ echo "usage: $0 <INPUT_FILE> <FIRST_PAGE> <LAST_PAGE> <OUTPUT_FILE>"
+ exit -1
+fi
+
+gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH \
+ -dFirstPage=$2 -dLastPage=$3 -sOutputFile=$4 $1
diff --git a/pdf_reduce_size.sh b/pdf_reduce_size.sh
new file mode 100755
index 0000000..87577de
--- /dev/null
+++ b/pdf_reduce_size.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+for file in $@; do
+ gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook \
+ -dNOPAUSE -dQUIET -dBATCH \
+ -sOutputFile="$(basename "$file" .pdf)_smaller.pdf" "$file"
+done