aboutsummaryrefslogtreecommitdiffstats
path: root/cli/pdf-merge.sh
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-12-29 17:22:21 +0800
committerAaron LI <aly@aaronly.me>2017-12-29 17:22:21 +0800
commit5322969e673f283e3d9413d925e9b2abcacde2af (patch)
tree717cfe3453780fe9714d69eeeb917f30c61ad3c2 /cli/pdf-merge.sh
parent2fc7288e321e637c97c1826a7ccb70b9a041373d (diff)
downloadatoolbox-5322969e673f283e3d9413d925e9b2abcacde2af.tar.bz2
Rename shrinkpdf.sh and mergepdf.sh
Diffstat (limited to 'cli/pdf-merge.sh')
-rwxr-xr-xcli/pdf-merge.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/cli/pdf-merge.sh b/cli/pdf-merge.sh
new file mode 100755
index 0000000..aef72db
--- /dev/null
+++ b/cli/pdf-merge.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# Merge multiple PDFs with pdftk.
+#
+# Ref:
+# Merging Multiple PDFs under GNU/Linux
+# https://blog.dbrgn.ch/2013/8/14/merge-multiple-pdfs/
+#
+# Weitian LI
+# 2015/01/23
+#
+
+if [ $# -lt 2 ]; then
+ printf "Usage: `basename $0` out.pdf in1.pdf ...\n"
+ exit 1
+fi
+
+outpdf="$1"
+shift
+
+echo "Input files: $@"
+pdftk "$@" cat output "${outpdf}"
+